|
12 | 12 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.togglebutton.xaml" />
|
13 | 13 | </ResourceDictionary.MergedDictionaries>
|
14 | 14 |
|
15 |
| - <Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> |
| 15 | + <Style x:Key="MaterialDesignToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> |
16 | 16 | <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/>
|
17 | 17 | <Setter Property="MinHeight" Value="0"/>
|
18 | 18 | <Setter Property="MinWidth" Value="0"/>
|
|
46 | 46 | </DataTrigger>
|
47 | 47 | </Style.Triggers>
|
48 | 48 | </Style>
|
49 |
| - <Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> |
| 49 | + |
| 50 | + <Style x:Key="MaterialDesignToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}"> |
50 | 51 | <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/>
|
51 | 52 | <Setter Property="MinHeight" Value="0"/>
|
52 | 53 | <Setter Property="MinWidth" Value="0"/>
|
|
80 | 81 | </DataTrigger>
|
81 | 82 | </Style.Triggers>
|
82 | 83 | </Style>
|
83 |
| - <Style x:Key="ToolBarThumbStyle" TargetType="{x:Type Thumb}"> |
| 84 | + |
| 85 | + <Style x:Key="MaterialDesignToolBarThumbStyle" TargetType="{x:Type Thumb}"> |
84 | 86 | <Setter Property="Template">
|
85 | 87 | <Setter.Value>
|
86 | 88 | <ControlTemplate TargetType="{x:Type Thumb}">
|
|
90 | 92 | <DrawingBrush TileMode="Tile" Viewbox="0,0,4,4" Viewport="0,0,4,4" ViewportUnits="Absolute" ViewboxUnits="Absolute">
|
91 | 93 | <DrawingBrush.Drawing>
|
92 | 94 | <DrawingGroup>
|
93 |
| - <GeometryDrawing Brush="White" Geometry="M 1 1 L 1 3 L 3 3 L 3 1 z"/> |
94 | 95 | <GeometryDrawing Brush="{DynamicResource MaterialDesignDivider}" Geometry="M 0 0 L 0 2 L 2 2 L 2 0 z"/>
|
95 | 96 | </DrawingGroup>
|
96 | 97 | </DrawingBrush.Drawing>
|
|
107 | 108 | </Setter.Value>
|
108 | 109 | </Setter>
|
109 | 110 | </Style>
|
110 |
| - <Style x:Key="ToolBarMainPanelBorderStyle" TargetType="{x:Type Border}"> |
| 111 | + |
| 112 | + <Style x:Key="MaterialDesignToolBarMainPanelBorderStyle" TargetType="{x:Type Border}"> |
111 | 113 | <Setter Property="Margin" Value="0,0,11,0"/>
|
112 | 114 | <Setter Property="CornerRadius" Value="3,3,3,3"/>
|
113 |
| - <Style.Triggers> |
114 |
| - <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> |
115 |
| - <Setter Property="CornerRadius" Value="0,0,0,0"/> |
116 |
| - </DataTrigger> |
117 |
| - </Style.Triggers> |
118 | 115 | </Style>
|
| 116 | + |
119 | 117 | <Style x:Key="MaterialDesignToolBar" TargetType="{x:Type ToolBar}">
|
120 | 118 | <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/>
|
121 | 119 | <Setter Property="FontFamily" Value="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"/>
|
122 | 120 | <Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}"/>
|
| 121 | + <Setter Property="ClipToBounds" Value="True"/> |
123 | 122 | <Setter Property="Template">
|
124 | 123 | <Setter.Value>
|
125 | 124 | <ControlTemplate TargetType="{x:Type ToolBar}">
|
126 | 125 | <DockPanel x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
|
127 | 126 | <Grid DockPanel.Dock="Right" x:Name="OverflowGrid" HorizontalAlignment="Right">
|
128 |
| - <ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{StaticResource ToolBarHorizontalOverflowButtonStyle}" |
| 127 | + <ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{StaticResource MaterialDesignToolBarHorizontalOverflowButtonStyle}" |
| 128 | + Foreground="{TemplateBinding Foreground}" |
129 | 129 | />
|
130 |
| - <Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false" Margin="1"> |
| 130 | + <Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false" Margin="1"> |
131 | 131 | <Border x:Name="ToolBarSubMenuBorder" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="1" Background="{DynamicResource MaterialDesignPaper}"
|
132 | 132 | TextBlock.FontWeight="ExtraBold"
|
133 | 133 | CornerRadius="2" Margin="1"
|
|
138 | 138 | </Border>
|
139 | 139 | </Popup>
|
140 | 140 | </Grid>
|
141 |
| - <Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Style="{StaticResource ToolBarMainPanelBorderStyle}"> |
| 141 | + <Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Style="{StaticResource MaterialDesignToolBarMainPanelBorderStyle}"> |
142 | 142 | <DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
|
143 |
| - <Thumb x:Name="ToolBarThumb" Margin="-3,-1,0,0" Padding="6,5,1,6" Style="{StaticResource ToolBarThumbStyle}" Width="10"/> |
| 143 | + <Thumb x:Name="ToolBarThumb" Margin="-3,-1,0,0" Padding="6,5,1,6" Style="{StaticResource MaterialDesignToolBarThumbStyle}" Width="10"/> |
144 | 144 | <ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4,0,4,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
|
145 | 145 | <ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" Margin="0,1,2,2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
146 | 146 | </DockPanel>
|
|
161 | 161 | </Trigger>
|
162 | 162 | <Trigger Property="Orientation" Value="Vertical">
|
163 | 163 | <Setter Property="Margin" TargetName="Grid" Value="1,3,1,1"/>
|
164 |
| - <Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource ToolBarVerticalOverflowButtonStyle}"/> |
| 164 | + <Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource MaterialDesignToolBarVerticalOverflowButtonStyle}"/> |
165 | 165 | <Setter Property="Height" TargetName="ToolBarThumb" Value="10"/>
|
166 | 166 | <Setter Property="Width" TargetName="ToolBarThumb" Value="Auto"/>
|
167 | 167 | <Setter Property="Margin" TargetName="ToolBarThumb" Value="-1,-3,0,0"/>
|
|
183 | 183 | </ControlTemplate>
|
184 | 184 | </Setter.Value>
|
185 | 185 | </Setter>
|
186 |
| - <Style.Triggers> |
187 |
| - <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true"> |
188 |
| - <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> |
189 |
| - </DataTrigger> |
190 |
| - </Style.Triggers> |
191 | 186 | </Style>
|
192 | 187 |
|
193 | 188 | <Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource MaterialDesignCheckBox}">
|
|
227 | 222 | <Setter Property="HorizontalContentAlignment" Value="Center"/>
|
228 | 223 | <Setter Property="VerticalContentAlignment" Value="Center"/>
|
229 | 224 | <Setter Property="TextBlock.FontWeight" Value="DemiBold"/>
|
| 225 | + <Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}"/> |
230 | 226 | <Setter Property="Template">
|
231 | 227 | <Setter.Value>
|
232 | 228 | <ControlTemplate TargetType="{x:Type Button}">
|
233 |
| - <wpf:VisualFeedbackContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Focusable="False" |
234 |
| - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
235 |
| - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
236 |
| - Padding="{TemplateBinding Padding}" |
237 |
| - SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
| 229 | + <wpf:VisualFeedbackContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Focusable="False" |
| 230 | + Foreground="{TemplateBinding Foreground}" |
| 231 | + ClipToBounds="False" |
| 232 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 233 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 234 | + Padding="{TemplateBinding Padding}" |
| 235 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
238 | 236 | <ControlTemplate.Triggers>
|
239 | 237 | <Trigger Property="IsEnabled" Value="false">
|
240 | 238 | <Setter Property="Opacity" Value=".56"/>
|
|
0 commit comments