1
0
mirror of https://github.com/DarthAffe/RGBSyncPlus synced 2025-12-13 09:28:31 +00:00
RGBSyncPlus/RGBSync+/Styles/BlurredDecorationWindow.xaml

126 lines
7.4 KiB
XML

<styles:CachedResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:RGBSyncPlus.Controls"
xmlns:styles="clr-namespace:RGBSyncPlus.Styles">
<styles:CachedResourceDictionary.MergedDictionaries>
<styles:CachedResourceDictionary Source="/RGBSync+;component/Styles/ImageButton.xaml" />
<styles:CachedResourceDictionary Source="/RGBSync+;component/Styles/Theme.xaml" />
</styles:CachedResourceDictionary.MergedDictionaries>
<Style x:Key="StyleImageButtonWindow"
BasedOn="{StaticResource StyleImageButtonWithOpacity}"
TargetType="{x:Type controls:ImageButton}">
<Setter Property="Padding" Value="4" />
<Setter Property="Margin" Value="4" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
</Style>
<Style x:Key="StyleBlurredDecorationWindow"
TargetType="{x:Type controls:BlurredDecorationWindow}">
<Setter Property="WindowStyle" Value="None" />
<Setter Property="ResizeMode" Value="CanResize" />
<Setter Property="AllowsTransparency" Value="True" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="BorderThickness" Value="1,0,1,1" />
<Setter Property="DecorationHeight" Value="80" />
<Setter Property="BorderBrush" Value="{StaticResource BrushWindowBorder}" />
<Setter Property="Background" Value="{StaticResource BrushWindowBackground}" />
<Setter Property="BackgroundImage" Value="pack://application:,,,/Resources/background.png" />
<Setter Property="MinWidth" Value="256" />
<Setter Property="MinHeight" Value="144" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="FontSize" Value="{StaticResource FontSizeDefault}" />
<Setter Property="FontFamily" Value="pack://application:,,,/Resources/#Cinzel" />
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="5" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:BlurredDecorationWindow}">
<Grid Background="{TemplateBinding Background}">
<Grid Margin="-12,-12,-12,0">
<Viewbox HorizontalAlignment="Center" Stretch="UniformToFill">
<Image Source="{TemplateBinding BackgroundImage}" />
</Viewbox>
<Border Name="BlurImage">
<Border.OpacityMask>
<VisualBrush TileMode="None" Stretch="None" AlignmentX="Center" AlignmentY="Center">
<VisualBrush.Visual>
<Grid Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Border}}"
Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Border}}">
<Grid.RowDefinitions>
<RowDefinition Height="12" />
<RowDefinition Height="92" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Rectangle Fill="Black" Grid.Row="0" Grid.RowSpan="2" />
<Rectangle Fill="Transparent" Grid.Row="2" />
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Border.OpacityMask>
<Border.Effect>
<BlurEffect Radius="30" />
</Border.Effect>
<Viewbox HorizontalAlignment="Center" Stretch="UniformToFill">
<Image Source="{TemplateBinding BackgroundImage}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Viewbox>
</Border>
</Grid>
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<DockPanel LastChildFill="True">
<Border x:Name="PART_Decoration"
DockPanel.Dock="Top"
HorizontalAlignment="Stretch"
Height="{TemplateBinding DecorationHeight}"
Background="{TemplateBinding BorderBrush}">
<DockPanel HorizontalAlignment="Stretch" Margin="4" LastChildFill="False">
<controls:ImageButton x:Name="PART_CloseButton"
DockPanel.Dock="Right"
Style="{StaticResource StyleImageButtonWindow}"
Image="pack://application:,,,/Resources/close.png"
ToolTip="Close" />
<controls:ImageButton x:Name="PART_MinimizeButton"
DockPanel.Dock="Right"
Style="{StaticResource StyleImageButtonWindow}"
Image="pack://application:,,,/Resources/minimize.png"
ToolTip="Minimize" />
<controls:ImageButton x:Name="PART_IconButton"
DockPanel.Dock="Left"
VerticalAlignment="Center"
Margin="8"
Style="{StaticResource StyleImageButtonWithOpacity}"
Image="{TemplateBinding Icon}"
ToolTip="https://github.com/DarthAffe/RGBSyncPlus" />
</DockPanel>
</Border>
<ContentPresenter x:Name="PART_Content" />
</DockPanel>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</styles:CachedResourceDictionary>