Skip to content

Commit

Permalink
(#118, #116) Moved package buttons and added maintainers.
Browse files Browse the repository at this point in the history
  • Loading branch information
RichiCoder1 committed Feb 23, 2014
1 parent 10a91d2 commit 236b12b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Chocolatey.Gui/Resources/Controls.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@
</Style>

<Style x:Key="EntypoIconLargeStyle" BasedOn="{StaticResource EntypoIconStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="72"/>
<Setter Property="FontSize" Value="58"/>
</Style>

<Style x:Key="BigEntypeIconButton" TargetType="{x:Type Button}" BasedOn="{StaticResource MetroCircleButtonStyle}">
<Setter Property="Width" Value="80"/>
<Setter Property="Height" Value="80"/>
<Setter Property="Width" Value="60"/>
<Setter Property="Height" Value="60"/>
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
<Setter Property="VerticalContentAlignment" Value="Top"></Setter>
<Setter Property="Foreground" Value="{StaticResource AccentColorBrush}"/>
Expand Down
2 changes: 2 additions & 0 deletions Chocolatey.Gui/ViewModels/Items/IPackageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public interface IPackageViewModel

string LicenseUrl { get; set; }

string Owners { get; set; }

string PackageHash { get; set; }

string PackageHashAlgorithm { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions Chocolatey.Gui/ViewModels/Items/PackageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ public string LicenseUrl
set { SetPropertyValue(ref _licenseUrl, value); }
}

private string _owners;
public string Owners
{
get { return _owners; }
set { SetPropertyValue(ref _owners, value); }
}

private string _packageHash;
public string PackageHash
{
Expand Down
30 changes: 21 additions & 9 deletions Chocolatey.Gui/Views/Controls/PackageControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,35 @@
<converters:LongSizeToFileSizeString x:Key="LongSizeToFileSizeString"/>
<converters:PackageDependenciesToString x:Key="PackageDependenciesToString"/>
<xaml:TextToFlowDocumentConverter x:Key="TextToFlowDocumentConverter" Markdown="{StaticResource Markdown}"/>

</UserControl.Resources>

<DockPanel x:Name="PackageViewGrid" LastChildFill="True" DataContext="{Binding Package}" d:DataContext="{d:DesignInstance items:PackageViewModel}"
Margin="20,0,0,0" Background="{StaticResource LightBackgroundColorBrush}"
Background="{StaticResource LightBackgroundColorBrush}"
Visibility="{Binding DataContext, RelativeSource={RelativeSource Self}, FallbackValue=Collapsed, Converter={StaticResource NullToVisibility}}">
<StackPanel DockPanel.Dock="Top">
<StackPanel DockPanel.Dock="Top" Margin="20,0,0,0">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource BackButtonStyle}" HorizontalAlignment="Left" VerticalAlignment="Top"
Command="{commands:DataContextCommandAdapter GoBack, CanGoBack}"></Button>
<TextBlock Style="{StaticResource TitleTextStyle}" AutomationProperties.Name="{Binding Title}"><Run Text="{Binding Title}" /></TextBlock>
<TextBlock AutomationProperties.Name="{Binding Version}" VerticalAlignment="Bottom"> <Run Text="{Binding Version}" Style="{StaticResource SubtitleRunTextStyle}" /></TextBlock>
</StackPanel>
<TextBlock Style="{StaticResource SubtitleTextStyle}" AutomationProperties.Name="{Binding Authors}"><Run Text="Authors: "/> <Run Text="{Binding Authors}" /></TextBlock>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource SubtitleTextStyle}" AutomationProperties.Name="{Binding Authors}"><Run Text="Authors: "/> <Run Text="{Binding Authors}" /></TextBlock>
<TextBlock Style="{StaticResource SubtitleTextStyle}" AutomationProperties.Name="{Binding Owners}"><Run Text=" | Maintainers: "/> <Run Text="{Binding Owners}" /></TextBlock>
</StackPanel>
</StackPanel>
<StackPanel DockPanel.Dock="Left">

<Grid DockPanel.Dock="Bottom">
<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource AccentColorBrush4}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,20,10">
<Button Style="{StaticResource InstallButtonStyle}" Command="{commands:DataContextCommandAdapter Install}" Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}, ConverterParameter=True}"/>
<Button Style="{StaticResource UninstallButtonStyle}" Command="{commands:DataContextCommandAdapter Uninstall}" Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}}"/>
<Button Style="{StaticResource UpdateButtonStyle}" Command="{commands:DataContextCommandAdapter Update}" Visibility="{Binding CanUpdate, Converter={StaticResource BooleanToVisibility}}"/>
</StackPanel>
</Border>
</Grid>

<StackPanel DockPanel.Dock="Left" Margin="20,0,0,0">
<Label Style="{StaticResource PackageResourceLabel}" Content="Downloads" Target="{Binding ElementName=VersionDownloadCount}"/>
<TextBlock x:Name="VersionDownloadCount" Text="{Binding VersionDownloadCount}" Style="{StaticResource PackageResourceValue}"></TextBlock>
<Label Style="{StaticResource PackageResourceLabel}" Content="Total Downloads" Target="{Binding ElementName=DownloadCount}"/>
Expand All @@ -60,13 +73,12 @@
</TextBlock>
</StackPanel>

<Button Style="{StaticResource InstallButtonStyle}" Command="{commands:DataContextCommandAdapter Install}" Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}, ConverterParameter=True}"/>
<Button Style="{StaticResource UninstallButtonStyle}" Command="{commands:DataContextCommandAdapter Uninstall}" Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}}"/>
<Button Style="{StaticResource UpdateButtonStyle}" Command="{commands:DataContextCommandAdapter Update}" Visibility="{Binding CanUpdate, Converter={StaticResource BooleanToVisibility}}"/>
</StackPanel>

<Grid DockPanel.Dock="Right">
<Image AutomationProperties.Name="Package Icon" Source="{Binding IconUrl, IsAsync=True}" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Top"/>
<Image AutomationProperties.Name="Package Icon" Source="{Binding IconUrl, IsAsync=True}"
Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Top"
Margin="0,0,20,0" />
</Grid>

<Grid Margin="25,5,0,0">
Expand Down

0 comments on commit 236b12b

Please sign in to comment.