2023-08-15 10:13:18 +12:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!-- Copyright (c) 2023-2023 Peter Kirmeier -->
|
|
|
|
<ResourceDictionary
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2023-08-23 07:48:55 +12:00
|
|
|
xmlns:u="clr-namespace:SystemTrayMenu.Utilities"
|
2023-08-15 10:13:18 +12:00
|
|
|
xmlns:stm="clr-namespace:SystemTrayMenu">
|
|
|
|
|
2023-08-23 07:48:55 +12:00
|
|
|
<!-- Control Template: https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/scrollbar-styles-and-templates -->
|
|
|
|
<!-- Path notation: https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/path-markup-syntax -->
|
|
|
|
<!-- Transform: https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/transforms-overview -->
|
2023-08-15 10:13:18 +12:00
|
|
|
|
|
|
|
<!-- TODO: Check and adjust horizontal scrollbars -->
|
|
|
|
<!-- TODO: Take care of disabled scrollbars -->
|
2023-08-23 07:48:55 +12:00
|
|
|
|
2023-08-15 10:13:18 +12:00
|
|
|
<Color x:Key="DisabledForegroundColor">Transparent</Color>
|
|
|
|
|
2023-08-23 07:48:55 +12:00
|
|
|
<ScaleTransform x:Key="ScaleFactor" ScaleX="1" ScaleY="1" /> <!-- TODO: Fill in factor on Scaling ctor ? (Mayb move to App.xaml) -->
|
|
|
|
|
2023-08-15 10:13:18 +12:00
|
|
|
<Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
|
|
|
<Setter Property="Focusable" Value="false" />
|
|
|
|
<Setter Property="Template">
|
|
|
|
<Setter.Value>
|
|
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
|
|
<Border x:Name="Border" Margin="0" CornerRadius="0" BorderThickness="0">
|
|
|
|
<Border.Background>
|
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
|
|
<LinearGradientBrush.GradientStops>
|
|
|
|
<GradientStopCollection>
|
|
|
|
<GradientStop Color="{TemplateBinding Background}" Offset="0.0"/>
|
|
|
|
<GradientStop Color="{TemplateBinding Background}" Offset="1.0" />
|
|
|
|
</GradientStopCollection>
|
|
|
|
</LinearGradientBrush.GradientStops>
|
|
|
|
</LinearGradientBrush>
|
|
|
|
</Border.Background>
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
|
|
<VisualState x:Name="Normal" />
|
|
|
|
<VisualState x:Name="MouseOver">
|
|
|
|
<Storyboard>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowHoverBackground},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowHoverBackground},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
|
|
|
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowHover},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
<VisualState x:Name="Pressed">
|
|
|
|
<Storyboard>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowClickBackground},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowClickBackground},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
|
|
|
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorArrowClick},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
<VisualState x:Name="Disabled">
|
|
|
|
<Storyboard>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
|
|
|
|
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledForegroundColor}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
</VisualStateGroup>
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
<Path x:Name="Arrow" HorizontalAlignment="Center" VerticalAlignment="Center"
|
2023-09-18 02:38:13 +12:00
|
|
|
RenderTransform="{StaticResource ScaleFactor}" RenderOptions.EdgeMode="Aliased"
|
2023-08-15 10:13:18 +12:00
|
|
|
Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" >
|
|
|
|
<Path.Fill>
|
|
|
|
<SolidColorBrush Color="{Binding Source={x:Static stm:MenuDefines.ColorArrow},Path=Color}"/>
|
|
|
|
</Path.Fill>
|
|
|
|
</Path>
|
|
|
|
</Border>
|
|
|
|
</ControlTemplate>
|
|
|
|
</Setter.Value>
|
|
|
|
</Setter>
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
<Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
|
|
|
<Setter Property="IsTabStop" Value="false" />
|
|
|
|
<Setter Property="Focusable" Value="false" />
|
|
|
|
<Setter Property="Template">
|
|
|
|
<Setter.Value>
|
|
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
|
|
<Border Background="Transparent" />
|
|
|
|
</ControlTemplate>
|
|
|
|
</Setter.Value>
|
|
|
|
</Setter>
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
|
|
|
<Setter Property="IsTabStop" Value="false" />
|
|
|
|
<Setter Property="Focusable" Value="false" />
|
|
|
|
<Setter Property="Template">
|
|
|
|
<Setter.Value>
|
|
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
2023-09-18 03:08:09 +12:00
|
|
|
<Border x:Name="Border" CornerRadius="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0">
|
2023-08-15 10:13:18 +12:00
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
|
|
<VisualState x:Name="Normal" />
|
|
|
|
<VisualState x:Name="MouseOver">
|
|
|
|
<Storyboard>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderHover},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderHover},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
<VisualState x:Name="Pressed">
|
|
|
|
<Storyboard>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderDragging},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
|
|
|
Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
|
|
|
|
<EasingColorKeyFrame KeyTime="0" Value="{Binding Source={x:Static stm:MenuDefines.ColorSliderDragging},Path=Color}" />
|
|
|
|
</ColorAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
<VisualState x:Name="Disabled" />
|
|
|
|
</VisualStateGroup>
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
</Border>
|
|
|
|
</ControlTemplate>
|
|
|
|
</Setter.Value>
|
|
|
|
</Setter>
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
|
2023-09-18 03:08:09 +12:00
|
|
|
<Border Background="{x:Static stm:MenuDefines.ColorScrollbarBackground}" BorderBrush="{x:Static stm:MenuDefines.ColorScrollbarBackground}" BorderThickness="1,0">
|
|
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition MaxHeight="{u:ScaleDouble 15}" />
|
|
|
|
<RowDefinition Height="0.00001*" />
|
|
|
|
<RowDefinition MaxHeight="{u:ScaleDouble 15}" />
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
<RepeatButton Grid.Row="0"
|
2023-08-15 10:13:18 +12:00
|
|
|
Style="{StaticResource ScrollBarLineButton}"
|
2023-08-23 07:48:55 +12:00
|
|
|
Height="{u:ScaleDouble 15}"
|
2023-08-15 10:13:18 +12:00
|
|
|
Command="ScrollBar.LineUpCommand"
|
2023-09-18 02:38:13 +12:00
|
|
|
Content="M 0 5 L 10 5 L 5 0 Z" />
|
2023-09-18 03:08:09 +12:00
|
|
|
<Track x:Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
|
|
|
|
<Track.DecreaseRepeatButton>
|
|
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
|
|
|
|
</Track.DecreaseRepeatButton>
|
|
|
|
<Track.Thumb>
|
|
|
|
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="0">
|
|
|
|
<Thumb.BorderBrush>
|
2023-08-15 10:13:18 +12:00
|
|
|
|
2023-09-18 03:08:09 +12:00
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
|
|
<LinearGradientBrush.GradientStops>
|
|
|
|
<GradientStopCollection>
|
|
|
|
<GradientStop Color="{TemplateBinding Background}" Offset="0.0" />
|
|
|
|
<GradientStop Color="{TemplateBinding Background}" Offset="1.0" />
|
|
|
|
</GradientStopCollection>
|
|
|
|
</LinearGradientBrush.GradientStops>
|
|
|
|
</LinearGradientBrush>
|
2023-08-15 10:13:18 +12:00
|
|
|
|
2023-09-18 03:08:09 +12:00
|
|
|
</Thumb.BorderBrush>
|
|
|
|
<Thumb.Background>
|
2023-08-15 10:13:18 +12:00
|
|
|
|
2023-09-18 03:08:09 +12:00
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
|
|
<LinearGradientBrush.GradientStops>
|
|
|
|
<GradientStopCollection>
|
|
|
|
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="0.0" />
|
|
|
|
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="1.0" />
|
|
|
|
</GradientStopCollection>
|
|
|
|
</LinearGradientBrush.GradientStops>
|
|
|
|
</LinearGradientBrush>
|
2023-08-15 10:13:18 +12:00
|
|
|
|
2023-09-18 03:08:09 +12:00
|
|
|
</Thumb.Background>
|
|
|
|
</Thumb>
|
|
|
|
</Track.Thumb>
|
|
|
|
<Track.IncreaseRepeatButton>
|
|
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
|
|
|
|
</Track.IncreaseRepeatButton>
|
|
|
|
</Track>
|
|
|
|
<RepeatButton Grid.Row="2"
|
2023-08-15 10:13:18 +12:00
|
|
|
Style="{StaticResource ScrollBarLineButton}"
|
2023-08-23 07:48:55 +12:00
|
|
|
Height="{u:ScaleDouble 15}"
|
2023-08-15 10:13:18 +12:00
|
|
|
Command="ScrollBar.LineDownCommand"
|
2023-09-18 02:38:13 +12:00
|
|
|
Content="M 0 0 L 5 5 L 10 0 Z" />
|
2023-09-18 03:08:09 +12:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
2023-08-15 10:13:18 +12:00
|
|
|
</ControlTemplate>
|
|
|
|
|
|
|
|
<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
|
2023-09-18 03:08:09 +12:00
|
|
|
<Border Background="{x:Static stm:MenuDefines.ColorScrollbarBackground}" BorderBrush="{x:Static stm:MenuDefines.ColorScrollbarBackground}" BorderThickness="0,1">
|
|
|
|
<Grid Background="{x:Static stm:MenuDefines.ColorScrollbarBackground}">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition MaxWidth="{u:ScaleDouble 15}" />
|
|
|
|
<ColumnDefinition Width="0.00001*" />
|
|
|
|
<ColumnDefinition MaxWidth="{u:ScaleDouble 15}" />
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<RepeatButton Grid.Column="0"
|
2023-08-15 10:13:18 +12:00
|
|
|
Style="{StaticResource ScrollBarLineButton}"
|
2023-08-23 07:48:55 +12:00
|
|
|
Width="{u:ScaleDouble 15}"
|
2023-08-15 10:13:18 +12:00
|
|
|
Command="ScrollBar.LineLeftCommand"
|
2023-09-18 02:38:13 +12:00
|
|
|
Content="M 5 0 L 5 10 L 0 5 Z" />
|
2023-09-18 03:08:09 +12:00
|
|
|
<Track x:Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
|
|
|
|
<Track.DecreaseRepeatButton>
|
|
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
|
|
|
|
</Track.DecreaseRepeatButton>
|
|
|
|
<Track.Thumb>
|
|
|
|
<Thumb Style="{StaticResource ScrollBarThumb}" Margin="0">
|
|
|
|
<Thumb.BorderBrush>
|
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
|
|
<LinearGradientBrush.GradientStops>
|
|
|
|
<GradientStopCollection>
|
|
|
|
<GradientStop Color="{TemplateBinding Background}" Offset="0.0" />
|
|
|
|
<GradientStop Color="{TemplateBinding Background}" Offset="1.0" />
|
|
|
|
</GradientStopCollection>
|
|
|
|
</LinearGradientBrush.GradientStops>
|
|
|
|
</LinearGradientBrush>
|
2023-08-15 10:13:18 +12:00
|
|
|
|
2023-09-18 03:08:09 +12:00
|
|
|
</Thumb.BorderBrush>
|
|
|
|
<Thumb.Background>
|
2023-08-15 10:13:18 +12:00
|
|
|
|
2023-09-18 03:08:09 +12:00
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
|
|
<LinearGradientBrush.GradientStops>
|
|
|
|
<GradientStopCollection>
|
|
|
|
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="0.0" />
|
|
|
|
<GradientStop Color="{Binding Source={x:Static stm:MenuDefines.ColorSlider},Path=Color}" Offset="1.0" />
|
|
|
|
</GradientStopCollection>
|
|
|
|
</LinearGradientBrush.GradientStops>
|
|
|
|
</LinearGradientBrush>
|
2023-08-15 10:13:18 +12:00
|
|
|
|
2023-09-18 03:08:09 +12:00
|
|
|
</Thumb.Background>
|
|
|
|
</Thumb>
|
|
|
|
</Track.Thumb>
|
|
|
|
<Track.IncreaseRepeatButton>
|
|
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
|
|
|
|
</Track.IncreaseRepeatButton>
|
|
|
|
</Track>
|
|
|
|
<RepeatButton Grid.Column="2"
|
2023-08-15 10:13:18 +12:00
|
|
|
Style="{StaticResource ScrollBarLineButton}"
|
2023-08-23 07:48:55 +12:00
|
|
|
Width="{u:ScaleDouble 15}"
|
2023-08-15 10:13:18 +12:00
|
|
|
Command="ScrollBar.LineRightCommand"
|
2023-09-18 02:38:13 +12:00
|
|
|
Content="M 0 0 L 5 5 L 0 10 Z" />
|
2023-09-18 03:08:09 +12:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
2023-08-15 10:13:18 +12:00
|
|
|
</ControlTemplate>
|
|
|
|
|
|
|
|
<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
|
|
<Style.Triggers>
|
|
|
|
<Trigger Property="Orientation" Value="Horizontal">
|
|
|
|
<Setter Property="Width" Value="Auto" />
|
2023-08-23 07:48:55 +12:00
|
|
|
<Setter Property="Height" Value="{u:ScaleDouble 15}" />
|
2023-08-15 10:13:18 +12:00
|
|
|
<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
|
|
|
|
</Trigger>
|
|
|
|
<Trigger Property="Orientation" Value="Vertical">
|
2023-08-23 07:48:55 +12:00
|
|
|
<Setter Property="Width" Value="{u:ScaleDouble 15}" />
|
2023-08-15 10:13:18 +12:00
|
|
|
<Setter Property="Height" Value="Auto" />
|
|
|
|
<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
|
|
|
|
</Trigger>
|
|
|
|
</Style.Triggers>
|
|
|
|
</Style>
|
|
|
|
</ResourceDictionary>
|