Skip to content

Commit

Permalink
Version 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Deytron committed Apr 18, 2020
1 parent 688acb7 commit 1601a6d
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 36 deletions.
21 changes: 11 additions & 10 deletions DerivedStyles/GridViewItemStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform />
Expand All @@ -17,7 +18,7 @@
<Grid Background="{DynamicResource GridItemBackgroundBrush}"
Margin="{Settings ItemSpacingMargin}"
x:Name="ItemGrid">
<Border x:Name="SelectionBorder" BorderThickness="0" Margin="0" />
<Border x:Name="SelectionBorder" BorderThickness="0"/>
<ContentPresenter />
</Grid>
<ControlTemplate.Triggers>
Expand All @@ -29,23 +30,26 @@
<Setter Property="BorderBrush" Value="{DynamicResource GlyphBrush}" TargetName="SelectionBorder"/>
<Setter Property="Canvas.ZIndex" Value="90" />
</Trigger>
<DataTrigger Binding="{Settings ShowGridItemBackground}" Value="False">
<Setter Property="Background" Value="Transparent" TargetName="ItemGrid" />
</DataTrigger>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetProperty="RenderTransform.ScaleX"
To="1.01"
Duration="0:0:.3"
To="1.05"
Duration="0:0:.5"
>
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation
Storyboard.TargetProperty="RenderTransform.ScaleY"
To="1.04"
Duration="0:0:.3"
To="1.05"
Duration="0:0:.5"
>
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
Expand All @@ -60,7 +64,7 @@
<DoubleAnimation
Storyboard.TargetProperty="RenderTransform.ScaleX"
To="1"
Duration="0:0:.2"
Duration="0:0:.4"
>
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
Expand All @@ -69,7 +73,7 @@
<DoubleAnimation
Storyboard.TargetProperty="RenderTransform.ScaleY"
To="1"
Duration="0:0:.2"
Duration="0:0:.4"
>
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
Expand All @@ -79,9 +83,6 @@
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<DataTrigger Binding="{Settings ShowGridItemBackground}" Value="False">
<Setter Property="Background" Value="Transparent" TargetName="ItemGrid" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
Expand Down
67 changes: 53 additions & 14 deletions DerivedStyles/GridViewItemTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,35 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d">

<Style x:Key="ControlButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="FontSize" Value="30" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="Foreground" Value="#66bba8ab" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<TextBlock FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding Content}"
TextWrapping="Wrap"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#66707070" />
</Trigger>
</Style.Triggers>
</Style>

<Style x:Key="GridViewItemTemplate" TargetType="{x:Type GameListItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GameListItem}">
<Border BorderThickness="{Settings GridItemMargin}" BorderBrush="{DynamicResource GridItemBackgroundBrush}">
<Border BorderThickness="{Settings GridItemMargin}" BorderBrush="Transparent">
<StackPanel Name="PART_PanelHost"
d:DataContext="{x:Static DesignMainViewModel.DesignSelectedGameIntance}">

Expand All @@ -18,26 +42,33 @@
RenderOptions.BitmapScalingMode="Fant" StretchDirection="Both"
HorizontalAlignment="Center" VerticalAlignment="Center"
Stretch="{Settings CoverArtStretch}" />

<Border Background="#99000000" x:Name="TextGameName" Visibility="Collapsed">
<Border Background="#90000000" x:Name="TextGameName" Visibility="Collapsed">
<TextBlock Text="{Binding DisplayName}"
TextWrapping="Wrap" Margin="5"
Style="{StaticResource BaseTextBlockStyle}"
TextTrimming="CharacterEllipsis" TextAlignment="Center"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Background="#1AFFFFFF" x:Name="BorderMouseOver" Visibility="Collapsed">
<Viewbox VerticalAlignment="Center" HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal">
<Button Name="PART_ButtonPlay" Style="{StaticResource SimpleButton}"
Margin="20,0,2,0" VerticalAlignment="Center"
<Border Background="#0EFFFFFF" x:Name="BorderMouseOver" Visibility="Collapsed" />
<Border Background="#AA000000" x:Name="BorderDarken" Visibility="Collapsed" />
<Viewbox Name="GameControls" Visibility="Collapsed">
<StackPanel Width="200" Height="267">
<Border Name="BorderControl" Margin="10,225,0,0" CornerRadius="4" BorderBrush="#40414141" BorderThickness="1" Height="40" Width="40"
HorizontalAlignment="Left" Background="#803a3a3a">
<Rectangle Fill="Transparent" Height="10" Width="10" HorizontalAlignment="Left"/>
</Border>
<Border Margin="0,-40,10,0" CornerRadius="4" BorderBrush="#40414141" BorderThickness="1" Height="40" Width="40"
HorizontalAlignment="Right" Background="#803a3a3a">
</Border>
<Button Name="PART_ButtonPlay" Style="{StaticResource ControlButton}"
Margin="15,-39,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Content="&#xec74;" FontFamily="{StaticResource FontIcoFont}" />
<Button Name="PART_ButtonInfo" Style="{StaticResource SimpleButton}"
Margin="2,0,20,0" VerticalAlignment="Center"
Content="&#xef4f;" FontFamily="{StaticResource FontIcoFont}" />
</StackPanel>
</Viewbox>
</Border>

<Button Name="PART_ButtonInfo" Style="{StaticResource ControlButton}"
Margin="0,-40,17,0" HorizontalAlignment="Right" VerticalAlignment="Center"
Content="&#128712;" FontFamily="{StaticResource FontIcoFont}" />
</StackPanel>
</Viewbox>
</Grid>
<TextBlock Text="{Binding DisplayName}"
Style="{DynamicResource BaseTextBlockStyle}"
Expand All @@ -52,6 +83,13 @@
<DataTrigger Binding="{Binding IsInstalled}" Value="False">
<Setter Property="Content" Value="&#xef08;" TargetName="PART_ButtonPlay" />
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsInstalled}" Value="False" />
<Condition Binding="{Settings DarkenUninstalledGamesGrid}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible" TargetName="BorderDarken" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding CoverImage}" Value="{x:Null}" />
Expand All @@ -61,6 +99,7 @@
</MultiDataTrigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Visibility" Value="Visible" TargetName="BorderMouseOver"/>
<Setter Property="Visibility" Value="Visible" TargetName="GameControls"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down
5 changes: 4 additions & 1 deletion DerivedStyles/PlayButton.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Style x:Key="PlayButton" TargetType="{x:Type Button}" BasedOn="{StaticResource BaseStyle}">
<Setter Property="FontFamily" Value="Corbel"/>
<Setter Property="Typography.Capitals" Value="AllSmallCaps"/>
Expand Down Expand Up @@ -57,7 +58,9 @@
<Border x:Name="DefaultBorder" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0" Background="{TemplateBinding Background}"
Opacity="1" CornerRadius="{DynamicResource ControlCornerRadius}"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
<TextBlock Text="" Opacity="0.9" FontFamily="Cambria" Padding="15,0,0,2" FontSize="22" FontWeight="Light" Background="Transparent" Foreground="{DynamicResource TextBrush}" VerticalAlignment="Center"/>
<TextBlock Text="" Opacity="0.9" FontFamily="Times New Roman" Padding="10,0,0,2" FontSize="25" FontWeight="Light" Background="Transparent" Foreground="{DynamicResource TextBrush}" VerticalAlignment="Center"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="34,0,15,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="True" />
Expand Down
28 changes: 28 additions & 0 deletions DerivedStyles/Simplebutton.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Style x:Key="SimpleButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="FontSize" Value="{DynamicResource FontSize}" />
<Setter Property="Margin" Value="0,3,0,3" />
<Setter Property="Foreground" Value="{DynamicResource GlyphBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<TextBlock FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding Content}"
TextWrapping="Wrap"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource TextBrushDarker}" />
</Trigger>
</Style.Triggers>
</Style>

</ResourceDictionary>
Loading

0 comments on commit 1601a6d

Please sign in to comment.