This commit is contained in:
NaBian committed 2022-10-04 23:42:18 +08:00
1 parent a7aba69403
commit 5e364ff1e7
5 files changed
+210 -334

No files matched your search

@@ -6433,6 +6433,7 @@
</Style>
<Style x:Key="MenuItemBaseStyle" TargetType="MenuItem">
<Setter Property="Padding" Value="{Binding Path=(hc:MenuAttach.ItemPadding),RelativeSource={RelativeSource AncestorType=MenuBase}}" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="hc:ScrollViewer.PanningMode" Value="Both" />
@@ -6620,6 +6621,7 @@
<Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
@@ -11625,78 +11627,40 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="ToggleButton">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Style x:Key="ToolBarOverflowButtonStyle" BasedOn="{StaticResource ToggleButtonIcon}" TargetType="ToggleButton">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="4" Background="{TemplateBinding Background}">
<Path x:Name="PathMore" Data="{StaticResource RightGeometry}" Height="8" Margin="4,4,8,4" HorizontalAlignment="Right" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform" SnapsToDevicePixels="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Fill" TargetName="PathMore" Value="{DynamicResource PrimaryBrush}" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="Fill" TargetName="PathMore" Value="{DynamicResource PrimaryBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="ToggleButton">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="MinHeight" Value="0" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="4" Background="{TemplateBinding Background}">
<Path x:Name="PathMore" Data="{StaticResource DownGeometry}" Width="8" Margin="4,4,4,8" VerticalAlignment="Bottom" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform" SnapsToDevicePixels="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Fill" TargetName="PathMore" Value="{DynamicResource PrimaryBrush}" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="Fill" TargetName="PathMore" Value="{DynamicResource PrimaryBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Height" Value="Auto" />
<Setter Property="Width" Value="Auto" />
<Setter Property="ClickMode" Value="Press" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource BorderBrush}" />
</Trigger>
</Style.Triggers>
</Style>
<ControlTemplate x:Key="ToolBarVerticalTemplate" TargetType="ToolBar">
<Grid x:Name="Grid" SnapsToDevicePixels="true">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<hc:SimplePanel x:Name="OverflowGrid" Grid.Row="1">
<ToggleButton Margin="0,4,0,0" x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{StaticResource ToolBarVerticalOverflowButtonStyle}" />
<Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Right" StaysOpen="false">
<Border x:Name="ToolBarSubMenuBorder" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}" RenderOptions.ClearTypeHint="Enabled">
<Border x:Name="MainPanelBorder" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid SnapsToDevicePixels="true">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
<Thumb x:Name="ToolBarThumb" DockPanel.Dock="Top" Style="{StaticResource ToolBarThumbVerticalStyle}" Height="10" Margin="0 4 0 0" />
<ContentPresenter x:Name="ToolBarHeader" DockPanel.Dock="Top" ContentSource="Header" HorizontalAlignment="Center" Margin="4 4 4 0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
<ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" />
</DockPanel>
<ToggleButton x:Name="ButtonOverflow" Margin="2 0 2 2" Padding="6 4" HorizontalContentAlignment="Right" hc:IconElement.Height="8" hc:IconSwitchElement.GeometrySelected="{StaticResource LeftGeometry}" hc:IconElement.Geometry="{StaticResource RightGeometry}" Style="{StaticResource ToolBarOverflowButtonStyle}" Grid.Row="1" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" />
<Popup PlacementTarget="{Binding ElementName=ButtonOverflow}" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Right" StaysOpen="false">
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}" RenderOptions.ClearTypeHint="Enabled">
<ToolBarOverflowPanel x:Name="PART_ToolBarOverflowPanel" KeyboardNavigation.DirectionalNavigation="Cycle" FocusVisualStyle="{x:Null}" Focusable="true" Margin="6" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" WrapWidth="200" />
</Border>
</Popup>
</hc:SimplePanel>
<Border x:Name="MainPanelBorder" Grid.Row="0" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
<Thumb x:Name="ToolBarThumb" DockPanel.Dock="Top" Style="{StaticResource ToolBarThumbVerticalStyle}" Height="10" />
<ContentPresenter x:Name="ToolBarHeader" DockPanel.Dock="Top" ContentSource="Header" HorizontalAlignment="Center" Margin="0,4,0,4" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
<ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</DockPanel>
</Border>
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsOverflowOpen" Value="true">
<Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false" />
@@ -11710,27 +11674,25 @@
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ToolBarHorizontalTemplate" TargetType="ToolBar">
<Grid x:Name="Grid" SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<hc:SimplePanel x:Name="OverflowGrid" Grid.Column="1">
<ToggleButton Margin="4,0,0,0" x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{StaticResource ToolBarHorizontalOverflowButtonStyle}" />
<Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false">
<Border x:Name="ToolBarSubMenuBorder" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}" RenderOptions.ClearTypeHint="Enabled">
<Border x:Name="MainPanelBorder" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
<Thumb x:Name="ToolBarThumb" Style="{StaticResource ToolBarThumbHorizontalStyle}" Width="10" Margin="4 0 0 0" />
<ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4 4 0 4" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
<ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" />
</DockPanel>
<ToggleButton x:Name="ButtonOverflow" Margin="0 2 2 2" Padding="4 6" VerticalContentAlignment="Bottom" hc:IconElement.Width="8" hc:IconSwitchElement.GeometrySelected="{StaticResource UpGeometry}" hc:IconElement.Geometry="{StaticResource DownGeometry}" Style="{StaticResource ToolBarOverflowButtonStyle}" Grid.Column="1" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" />
<Popup PlacementTarget="{Binding ElementName=ButtonOverflow}" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false">
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}" RenderOptions.ClearTypeHint="Enabled">
<ToolBarOverflowPanel x:Name="PART_ToolBarOverflowPanel" KeyboardNavigation.DirectionalNavigation="Cycle" FocusVisualStyle="{x:Null}" Focusable="true" Margin="6" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" WrapWidth="200" />
</Border>
</Popup>
</hc:SimplePanel>
<Border x:Name="MainPanelBorder" Grid.Column="0" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
<Thumb x:Name="ToolBarThumb" Style="{StaticResource ToolBarThumbHorizontalStyle}" Width="10" />
<ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4,0,4,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
<ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</DockPanel>
</Border>
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsOverflowOpen" Value="true">
<Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false" />
@@ -11745,8 +11707,8 @@
</ControlTemplate>
<Style x:Key="ToolBarBaseStyle" TargetType="ToolBar">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="Padding" Value="4" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="Margin" Value="0,0,4,4" />
<Setter Property="Template" Value="{StaticResource ToolBarHorizontalTemplate}" />
<Style.Triggers>
<Trigger Property="Orientation" Value="Vertical">