-
-
Notifications
You must be signed in to change notification settings - Fork 3
Addition in a custom theme
Lacro59 edited this page Dec 23, 2021
·
13 revisions
You can see a example with https://github.com/Lacro59/playnite-defaultextend-theme.
Differents resources disponible with PluginSettings
The SourceName for the plugin is BackgroundChanger
CustomOption | Type | Default | Description |
---|---|---|---|
EnableBackgroundImage | bool | false | Parameters to display or not the plugin background image. |
EnableImageAnimatedBackground | bool | false | Indicates if background image animation is enabled. |
EnableCoverImage | bool | false | Parameters to display or not the plugin cover image. |
EnableImageAnimatedCover | bool | false | Indicates if cover image animation is enabled. |
CustomOption | Type | Default | Description |
---|---|---|---|
HasDataBackground | bool | false | Indicates if the game has background images. |
HasDataCover | bool | false | Indicates if the game has cover images |
Integration of plugin elements with ContentControl
<StackPanel Visibility="{PluginStatus Plugin=<PluginId>, Status=Installed}">
</StackPanel>
If the item is not enabled in the plugin settings, it is collapsed.
<StackPanel Visibility="{Binding ElementName=<SourceName>_<ElementName>, Path=Visibility}">
</StackPanel>
<StackPanel Tag="{PluginSettings Plugin=BackgroundChanger, Path=HasDataBackground}">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=BackgroundChanger_PluginBackgroundImage, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<FadeImage x:Name="PART_ImageBackground" Stretch="Uniform"
HorizontalAlignment="Center" VerticalAlignment="Top">
<FadeImage.ImageOpacityMask>
<RadialGradientBrush GradientOrigin="0.5,0" Center="0.5,0" RadiusX="2" RadiusY="0.9">
<RadialGradientBrush.GradientStops>
<GradientStop Color="Black" Offset="0.3" />
<GradientStop Color="Transparent" Offset="1" />
</RadialGradientBrush.GradientStops>
</RadialGradientBrush>
</FadeImage.ImageOpacityMask>
</FadeImage>
</StackPanel>
<!-- BackgroundChanger plugin background -->
<ContentControl x:Name="BackgroundChanger_PluginBackgroundImage"
HorizontalAlignment="Center" VerticalAlignment="Top" />
<StackPanel DockPanel.Dock="Right" VerticalAlignment="Bottom"
Tag="{PluginSettings Plugin=BackgroundChanger, Path=HasDataCover}">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=BackgroundChanger_PluginCoverImage, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<Image Name="PART_ImageCover" VerticalAlignment="Bottom"
Height="{Settings GameDetailsCoverHeight}"
StretchDirection="Both" Stretch="Uniform"
RenderOptions.BitmapScalingMode="Fant" />
</StackPanel>
<ContentControl x:Name="BackgroundChanger_PluginCoverImage"
DockPanel.Dock="Right" VerticalAlignment="Bottom"
Height="{Settings GameDetailsCoverHeight}" />