mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
339 lines
18 KiB
XML
339 lines
18 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<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" Background="{DynamicResource ScrollBarLineButtonBackground}" Margin="0">
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualState x:Name="Normal" />
|
|
<VisualState x:Name="MouseOver">
|
|
<Storyboard>
|
|
<ColorAnimation To="{DynamicResource ScrollBarLineButtonBackgroundPointerOver}"
|
|
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
|
|
Duration="0"/>
|
|
<ColorAnimation To="{DynamicResource ScrollBarLineButtonForegroundPointerOver}"
|
|
Storyboard.TargetName="Arrow"
|
|
Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
|
|
Duration="0"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Pressed">
|
|
<Storyboard>
|
|
<ColorAnimation To="{DynamicResource ScrollBarLineButtonBackgroundPointerPressed}"
|
|
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
|
|
Duration="0"/>
|
|
<ColorAnimation To="{DynamicResource ScrollBarLineButtonForegroundPointerPressed}"
|
|
Storyboard.TargetName="Arrow"
|
|
Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)"
|
|
Duration="0"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Disabled"/>
|
|
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
<TextBlock x:Name="Arrow"
|
|
FontFamily="Segoe MDL2 Assets"
|
|
FontSize="8"
|
|
Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
|
|
Foreground="{DynamicResource ScrollBarLineButtonForeground}"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"/>
|
|
</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}">
|
|
<Border x:Name="Border" HorizontalAlignment="Stretch" Background="{DynamicResource ScrollBarThumbBackground}"
|
|
BorderBrush="{TemplateBinding BorderBrush}">
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualState x:Name="Normal" />
|
|
<VisualState x:Name="MouseOver">
|
|
<Storyboard>
|
|
<ColorAnimation To="{DynamicResource ScrollBarThumbPointerOver}"
|
|
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
|
|
Duration="0"
|
|
/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Pressed">
|
|
<Storyboard>
|
|
<ColorAnimation To="{DynamicResource ScrollBarThumbPressedColor}"
|
|
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
|
|
Duration="0"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Disabled"/>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
|
|
<Grid Background="Transparent">
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualState x:Name="Normal" />
|
|
<VisualState x:Name="MouseOver">
|
|
<Storyboard>
|
|
<ColorAnimation To="{DynamicResource ScrollBarBackgroundPointerOver}"
|
|
Storyboard.TargetProperty="(Grid.Background).(SolidColorBrush.Color)"
|
|
Duration="0"/>
|
|
<DoubleAnimation To="16"
|
|
Storyboard.TargetName="ScrollThumb"
|
|
Storyboard.TargetProperty="Width"
|
|
Duration="0:0:0.15">
|
|
<DoubleAnimation.EasingFunction>
|
|
<CubicEase EasingMode="EaseOut" />
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
|
|
<DoubleAnimation To="1"
|
|
Storyboard.TargetName="UpButton"
|
|
Storyboard.TargetProperty="Opacity"
|
|
Duration="0:0:0.15"/>
|
|
|
|
<DoubleAnimation To="1"
|
|
Storyboard.TargetName="DownButton"
|
|
Storyboard.TargetProperty="Opacity"
|
|
Duration="0:0:0.15"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Pressed"/>
|
|
<VisualState x:Name="Disabled"/>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition MaxHeight="16" />
|
|
<RowDefinition Height="0.00001*" />
|
|
<RowDefinition MaxHeight="16" />
|
|
</Grid.RowDefinitions>
|
|
<RepeatButton x:Name="UpButton" Opacity="0" Grid.Row="0"
|
|
Style="{StaticResource ScrollBarLineButton}"
|
|
Height="16"
|
|
Command="ScrollBar.LineUpCommand"
|
|
Content="" />
|
|
<Track x:Name="PART_Track"
|
|
Grid.Row="1"
|
|
IsDirectionReversed="true">
|
|
<Track.DecreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
|
Command="ScrollBar.PageUpCommand" />
|
|
</Track.DecreaseRepeatButton>
|
|
<Track.Thumb>
|
|
<Thumb x:Name="ScrollThumb" HorizontalAlignment="Right" Width="4" Style="{StaticResource ScrollBarThumb}"/>
|
|
</Track.Thumb>
|
|
<Track.IncreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
|
Command="ScrollBar.PageDownCommand" />
|
|
</Track.IncreaseRepeatButton>
|
|
</Track>
|
|
<RepeatButton x:Name="DownButton" Opacity="0" Grid.Row="2"
|
|
Style="{StaticResource ScrollBarLineButton}"
|
|
Height="16"
|
|
Command="ScrollBar.LineDownCommand"
|
|
Content="" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
|
|
<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
|
|
<Grid Background="Transparent">
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualState x:Name="Normal" />
|
|
<VisualState x:Name="MouseOver">
|
|
<Storyboard>
|
|
<ColorAnimation To="{DynamicResource ScrollBarBackgroundPointerOver}"
|
|
Storyboard.TargetProperty="(Grid.Background).(SolidColorBrush.Color)"
|
|
Duration="0"/>
|
|
<DoubleAnimation To="16"
|
|
Storyboard.TargetName="ScrollThumb"
|
|
Storyboard.TargetProperty="Height"
|
|
Duration="0:0:0.15">
|
|
<DoubleAnimation.EasingFunction>
|
|
<CubicEase EasingMode="EaseOut" />
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
|
|
<DoubleAnimation To="1"
|
|
Storyboard.TargetName="LeftButton"
|
|
Storyboard.TargetProperty="Opacity"
|
|
Duration="0:0:0.15"/>
|
|
|
|
<DoubleAnimation To="1"
|
|
Storyboard.TargetName="RightButton"
|
|
Storyboard.TargetProperty="Opacity"
|
|
Duration="0:0:0.15"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Pressed"/>
|
|
<VisualState x:Name="Disabled"/>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition MaxWidth="16" />
|
|
<ColumnDefinition Width="0.00001*" />
|
|
<ColumnDefinition MaxWidth="16" />
|
|
</Grid.ColumnDefinitions>
|
|
<RepeatButton x:Name="LeftButton" Grid.Column="0" Opacity="0"
|
|
Style="{StaticResource ScrollBarLineButton}"
|
|
Width="16"
|
|
Command="ScrollBar.LineLeftCommand"
|
|
Content="" />
|
|
<Track x:Name="PART_Track"
|
|
Grid.Column="1"
|
|
IsDirectionReversed="False">
|
|
<Track.DecreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
|
Command="ScrollBar.PageLeftCommand" />
|
|
</Track.DecreaseRepeatButton>
|
|
<Track.Thumb>
|
|
<Thumb x:Name="ScrollThumb" VerticalAlignment="Bottom" Height="4" Style="{StaticResource ScrollBarThumb}"/>
|
|
</Track.Thumb>
|
|
<Track.IncreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource ScrollBarPageButton}"
|
|
Command="ScrollBar.PageRightCommand" />
|
|
</Track.IncreaseRepeatButton>
|
|
</Track>
|
|
<RepeatButton x:Name="RightButton" Opacity="0" Grid.Column="2"
|
|
Style="{StaticResource ScrollBarLineButton}"
|
|
Width="16"
|
|
Command="ScrollBar.LineRightCommand"
|
|
Content="" />
|
|
</Grid>
|
|
</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" />
|
|
<Setter Property="Height"
|
|
Value="16" />
|
|
<Setter Property="Template"
|
|
Value="{StaticResource HorizontalScrollBar}" />
|
|
</Trigger>
|
|
<Trigger Property="Orientation"
|
|
Value="Vertical">
|
|
<Setter Property="Width"
|
|
Value="16" />
|
|
<Setter Property="Height"
|
|
Value="Auto" />
|
|
<Setter Property="Template"
|
|
Value="{StaticResource VerticalScrollBar}" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style TargetType="{x:Type ScrollViewer}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" HorizontalAlignment="Stretch" Grid.ColumnSpan="2" Grid.RowSpan="2" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
|
<ScrollBar Grid.Column="1" x:Name="PART_VerticalScrollBar"
|
|
Value="{TemplateBinding VerticalOffset}" Maximum="{
|
|
TemplateBinding ScrollableHeight}" ViewportSize="{
|
|
TemplateBinding ViewportHeight}" Background="Transparent" />
|
|
<ScrollBar Grid.Row="1" x:Name="PART_HorizontalScrollBar"
|
|
Orientation="Horizontal" Value="{TemplateBinding
|
|
HorizontalOffset}" Maximum="{TemplateBinding ScrollableWidth}"
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
|
Background="Transparent" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!--<Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}">
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<ScrollContentPresenter Grid.ColumnSpan="2" Grid.RowSpan="2"/>
|
|
<ScrollBar
|
|
|
|
Name="PART_VerticalScrollBar"
|
|
Grid.Column="1"
|
|
Value="{TemplateBinding VerticalOffset}"
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" />
|
|
<ScrollBar
|
|
|
|
Name="PART_HorizontalScrollBar"
|
|
Orientation="Horizontal"
|
|
Grid.Row="1"
|
|
Value="{TemplateBinding HorizontalOffset}"
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>-->
|
|
</ResourceDictionary> |