|
60 | 60 | </DockPanel>
|
61 | 61 | </Design.PreviewWith>
|
62 | 62 |
|
| 63 | + <!-- TODO: Consider refactoring with separate ControlThemes for the different Menu types |
| 64 | + (instead of multiple individual variations on the property level) --> |
63 | 65 | <ControlTheme x:Key="FluentTopLevelMenuItem" TargetType="MenuItem">
|
64 | 66 | <Setter Property="FontSize">
|
65 | 67 | <Setter.Value>
|
|
92 | 94 | BorderThickness="{TemplateBinding BorderThickness}"
|
93 | 95 | VerticalAlignment="Top">
|
94 | 96 | <Panel>
|
| 97 | + <Border Name="MenuItemActiveBackground" |
| 98 | + Background="Transparent" |
| 99 | + CornerRadius="{StaticResource SelectionCornerRadius}" |
| 100 | + Margin="{DynamicResource MenuItemActiveBackgroundMargin}"> |
| 101 | + <Border.IsVisible> |
| 102 | + <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
| 103 | + ConverterParameter="MacOS_Theme_MenuLabelBelowIcon"> |
| 104 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
| 105 | + <Binding Source="{x:False}" /> |
| 106 | + <Binding Source="{x:True}" /> |
| 107 | + </MultiBinding> |
| 108 | + </Border.IsVisible> |
| 109 | + </Border> |
95 | 110 | <StackPanel>
|
96 | 111 | <StackPanel.Orientation>
|
97 | 112 | <MultiBinding Converter="{StaticResource ClassToChoiceConverter}"
|
|
113 | 128 | </MultiBinding>
|
114 | 129 | </Border.Padding>
|
115 | 130 | <Panel>
|
116 |
| - <Border Name="ItemActiveBackground" |
| 131 | + <Border Name="ToolBarItemActiveBackground" |
117 | 132 | Background="Transparent"
|
118 | 133 | CornerRadius="{StaticResource SelectionCornerRadius}"
|
119 | 134 | Margin="{DynamicResource MenuToolBarItemActiveBackgroundMargin}">
|
|
180 | 195 | TextWrapping="Wrap"
|
181 | 196 | HorizontalContentAlignment="Center"
|
182 | 197 | TextAlignment="Center"
|
183 |
| - RecognizesAccessKey="True"> |
| 198 | + RecognizesAccessKey="True" |
| 199 | + Classes="TopLevelMenuItem"> |
184 | 200 | <ContentPresenter.IsVisible>
|
185 | 201 | <MultiBinding Converter="{StaticResource ClassToChoiceConverter}"
|
186 | 202 | ConverterParameter="MacOS_Theme_MenuItemIconOnly">
|
|
199 | 215 | IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}"
|
200 | 216 | Placement="BottomEdgeAlignedLeft"
|
201 | 217 | HorizontalOffset="{DynamicResource MenuPopupHorizontalOffset}"
|
202 |
| - VerticalOffset="{DynamicResource MenuPopupBelowVerticalOffset}" |
203 | 218 | OverlayInputPassThroughElement="{Binding $parent[Menu]}">
|
| 219 | + <Popup.VerticalOffset> |
| 220 | + <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
| 221 | + ConverterParameter="MacOS_Theme_MenuLabelBelowIcon"> |
| 222 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
| 223 | + <Binding Source="{StaticResource MenuToolBarPopupVerticalOffset}" /> |
| 224 | + <Binding Source="{StaticResource MenuPopupVerticalOffset}" /> |
| 225 | + </MultiBinding> |
| 226 | + </Popup.VerticalOffset> |
204 | 227 | <Border Margin="{StaticResource PopupMargin} "
|
205 | 228 | Background="{DynamicResource PopupBackgroundBrush}"
|
206 | 229 | BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}"
|
|
248 | 271 | </Style>
|
249 | 272 |
|
250 | 273 | <Style Selector="^:open, ^:pointerover">
|
251 |
| - <Style Selector="^ /template/ Border#ItemActiveBackground"> |
| 274 | + <Style Selector="^ /template/ Border#MenuItemActiveBackground"> |
| 275 | + <Setter Property="Background" Value="{DynamicResource LayoutBackgroundMidBrush}" /> |
| 276 | + </Style> |
| 277 | + </Style> |
| 278 | + |
| 279 | + <Style Selector="^:pressed"> |
| 280 | + <Style Selector="^ /template/ Border#MenuItemActiveBackground"> |
| 281 | + <Setter Property="Background" Value="{DynamicResource LayoutBackgroundHighBrush}" /> |
| 282 | + </Style> |
| 283 | + </Style> |
| 284 | + |
| 285 | + <Style Selector="^:open, ^:pointerover"> |
| 286 | + <Style Selector="^ /template/ Border#ToolBarItemActiveBackground"> |
252 | 287 | <Setter Property="Background" Value="{DynamicResource LayoutBackgroundMidBrush}" />
|
253 | 288 | </Style>
|
254 | 289 | </Style>
|
255 | 290 |
|
256 | 291 | <Style Selector="^:pressed">
|
257 |
| - <Style Selector="^ /template/ Border#ItemActiveBackground"> |
| 292 | + <Style Selector="^ /template/ Border#ToolBarItemActiveBackground"> |
258 | 293 | <Setter Property="Background" Value="{DynamicResource LayoutBackgroundHighBrush}" />
|
259 | 294 | </Style>
|
260 | 295 | </Style>
|
261 | 296 |
|
262 |
| - <Style Selector="^:empty /template/ Border#ItemActiveBackground"> |
| 297 | + <Style Selector="^:empty /template/ Border#ToolBarItemActiveBackground"> |
263 | 298 | <Setter Property="Margin" Value="-13 -4" />
|
264 | 299 | </Style>
|
265 | 300 |
|
|
0 commit comments