Skip to content

Commit

Permalink
Library: Added ThemeModifier extension option to use low performance …
Browse files Browse the repository at this point in the history
…blurred game background image
  • Loading branch information
darklinkpower committed Sep 12, 2023
1 parent 9b43a4b commit f52848d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
4 changes: 1 addition & 3 deletions source/Constants.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
xmlns:popt="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">

<!--Theme settings region start-->
<sys:Double x:Key="LibraryGameBackgroundBlendValue">1.0</sys:Double>
<sys:Boolean x:Key="LibraryGameBackgroundBlendWithBackground">True</sys:Boolean>
<sys:Boolean x:Key="LibraryGameBackgroundAnimateTransition">False</sys:Boolean>
<sys:Boolean x:Key="LibraryUseLowPerformanceBlurBackground">False</sys:Boolean>
<sys:Double x:Key="DetailsViewDetailsMaxWidth">1024</sys:Double>
<sys:Boolean x:Key="DetailsViewBackgroundImageUseOpacityMask">True</sys:Boolean>
<sys:Boolean x:Key="DetailsViewDisplayGameNameIfLogoVisible">True</sys:Boolean>
Expand Down
33 changes: 6 additions & 27 deletions source/Views/Library.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@
<Viewbox Grid.RowSpan="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Stretch="UniformToFill">
<FadeImage Name="BlurGameBackground" ImageDarkeningBrush="#990E0E0E"
HighQualityBlur="False" SourceUpdateDelay="150"
IsBlurEnabled="True" AnimationEnabled="{DynamicResource LibraryGameBackgroundAnimateTransition}"
IsBlurEnabled="True" AnimationEnabled="{Settings BackgroundImageAnimation}"
Height="96" RenderOptions.BitmapScalingMode="LowQuality" BlurAmount="10"
HorizontalAlignment="Center" VerticalAlignment="Top">
<FadeImage.Style>
<Style TargetType="FadeImage">
<Setter Property="Source" Value="{Binding ElementName=PART_ImageBackground, Path=Source}" />
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<!--<DataTrigger Binding="{Binding ElementName=PART_ImageBackground, Path=ActualHeight}" Value="0">
<Setter Property="Source" Value="{x:Null}" />
</DataTrigger>-->
<DataTrigger Binding="{Binding ElementName=LibraryGameBackgroundBlendWithBackground, Path=Tag}" Value="False">
<DataTrigger Binding="{Binding ElementName=LibraryUseLowPerformanceBlurBackground, Path=Tag}" Value="False">
<Setter Property="Source" Value="{x:Null}" />
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
Expand All @@ -44,37 +41,19 @@
</FadeImage>
</Viewbox>

<TextBlock x:Name="LibraryGameBackgroundBlendValue"
Tag="{DynamicResource LibraryGameBackgroundBlendValue}"
Visibility="Collapsed" />

<TextBlock x:Name="LibraryGameBackgroundBlendWithBackground"
Tag="{DynamicResource LibraryGameBackgroundBlendWithBackground}"
<TextBlock x:Name="LibraryUseLowPerformanceBlurBackground"
Tag="{DynamicResource LibraryUseLowPerformanceBlurBackground}"
Visibility="Collapsed" />

<FadeImage x:Name="PART_ImageBackground"
ImageDarkeningBrush="#990E0E0E"
Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
HorizontalAlignment="Center" VerticalAlignment="Top">
<FadeImage.Style>
<Style TargetType="FadeImage">
<Setter Property="Opacity" Value="{Binding ElementName=LibraryGameBackgroundBlendValue, Path=Tag}" />
<Setter Property="Visibility" Value="Visible" />
<Setter Property="OpacityMask">
<Setter.Value>
<RadialGradientBrush GradientOrigin="0.8,0.2" Center="0.8,0.2" RadiusX="1.1" RadiusY="0.90">
<RadialGradientBrush.GradientStops>
<GradientStop Color="Black" Offset="0.3" />
<GradientStop Color="Transparent" Offset="0.83" />
</RadialGradientBrush.GradientStops>
</RadialGradientBrush>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=LibraryGameBackgroundBlendWithBackground, Path=Tag}" Value="False">
<Setter Property="Opacity" Value="1.0" />
<Setter Property="OpacityMask" Value="Black" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=LibraryGameBackgroundBlendValue, Path=Tag}" Value="0">
<DataTrigger Binding="{Binding ElementName=LibraryUseLowPerformanceBlurBackground, Path=Tag}" Value="True">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
Expand Down
4 changes: 1 addition & 3 deletions source/thememodifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ Constants:
- "Sidebar"
- SidebarUseTransparentBackground: 'Use transparent background'
- "Library"
- LibraryGameBackgroundBlendWithBackground: 'Blend Game image background with blur background'
- LibraryGameBackgroundBlendValue(0.0,1.0): 'Background blend with blur background amount'
- LibraryGameBackgroundAnimateTransition: 'Animate blur background transition'
- LibraryUseLowPerformanceBlurBackground: 'Use low performance blurred game background image'
- "Details View"
- DetailsViewBackgroundImageUseOpacityMask: 'Fade background image to transparency'
- DetailsViewDisplayGameNameIfLogoVisible: 'Display game name if logo is visible'
Expand Down

0 comments on commit f52848d

Please sign in to comment.