|
90 | 90 | Background="{TemplateBinding Background}"
|
91 | 91 | BorderBrush="{TemplateBinding BorderBrush}"
|
92 | 92 | BorderThickness="{TemplateBinding BorderThickness}"
|
93 |
| - CornerRadius="{StaticResource SelectionCornerRadius}" |
94 | 93 | VerticalAlignment="Top">
|
95 | 94 | <Panel>
|
96 | 95 | <StackPanel>
|
|
102 | 101 | <Binding Source="{x:Static Orientation.Horizontal}" />
|
103 | 102 | </MultiBinding>
|
104 | 103 | </StackPanel.Orientation>
|
105 |
| - <StackPanel |
106 |
| - Orientation="Horizontal" |
107 |
| - VerticalAlignment="Center" |
108 |
| - HorizontalAlignment="Center" |
109 |
| - ToolTip.Tip="{TemplateBinding Header}"> |
110 |
| - <ContentPresenter Name="PART_IconPresenter" |
111 |
| - Content="{TemplateBinding Icon}"> |
112 |
| - <ToolTip.ServiceEnabled> |
113 |
| - <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
114 |
| - ConverterParameter="MacOS_Theme_MenuItemIconOnly"> |
115 |
| - <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
116 |
| - <Binding Source="{x:True}" /> |
117 |
| - <Binding Source="{x:False}" /> |
118 |
| - </MultiBinding> |
119 |
| - </ToolTip.ServiceEnabled> |
120 |
| - </ContentPresenter> |
121 |
| - <Panel Name="PART_ChevronPanel"> |
122 |
| - <Border Name="PART_ChevronBorder" Margin="3 0 0 0 "> |
123 |
| - <Path Name="PART_ChevronPath" |
124 |
| - Data="{StaticResource ChevronPath}" |
125 |
| - Width="{StaticResource TreeViewItemChevronSize}" |
126 |
| - Height="{StaticResource TreeViewItemChevronSize}" |
127 |
| - Fill="{TemplateBinding Foreground}" |
128 |
| - Stretch="Uniform" |
129 |
| - HorizontalAlignment="Center" |
130 |
| - VerticalAlignment="Center"> |
131 |
| - <Path.RenderTransform> |
132 |
| - <TransformGroup> |
133 |
| - <RotateTransform Angle="180" /> |
134 |
| - </TransformGroup> |
135 |
| - </Path.RenderTransform> |
136 |
| - <Path.IsVisible> |
137 |
| - <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
138 |
| - ConverterParameter="MacOS_Theme_MenuLabelBelowIcon"> |
139 |
| - <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
140 |
| - <Binding Source="{x:True}" /> |
141 |
| - <Binding Source="{x:False}" /> |
142 |
| - </MultiBinding> |
143 |
| - </Path.IsVisible> |
144 |
| - </Path> |
| 104 | + <Border Name="FlexiblePaddingIconBorder" |
| 105 | + HorizontalAlignment="Center" |
| 106 | + Background="Transparent"> |
| 107 | + <Border.Padding> |
| 108 | + <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
| 109 | + ConverterParameter="MacOS_Theme_MenuLabelBelowIcon"> |
| 110 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
| 111 | + <Binding Source="{StaticResource MenuToolBarItemIconPadding}" /> |
| 112 | + <Binding Source="{StaticResource MenuItemIconPadding}" /> |
| 113 | + </MultiBinding> |
| 114 | + </Border.Padding> |
| 115 | + <Panel> |
| 116 | + <Border Name="ItemActiveBackground" |
| 117 | + Background="Transparent" |
| 118 | + CornerRadius="{StaticResource SelectionCornerRadius}" |
| 119 | + Margin="{DynamicResource MenuToolBarItemActiveBackgroundMargin}"> |
| 120 | + <Border.IsVisible> |
| 121 | + <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
| 122 | + ConverterParameter="MacOS_Theme_MenuLabelBelowIcon"> |
| 123 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
| 124 | + <Binding Source="{x:True}" /> |
| 125 | + <Binding Source="{x:False}" /> |
| 126 | + </MultiBinding> |
| 127 | + </Border.IsVisible> |
145 | 128 | </Border>
|
| 129 | + <StackPanel |
| 130 | + Orientation="Horizontal" |
| 131 | + VerticalAlignment="Center" |
| 132 | + HorizontalAlignment="Center" |
| 133 | + ToolTip.Tip="{TemplateBinding Header}"> |
| 134 | + <ToolTip.ServiceEnabled> |
| 135 | + <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
| 136 | + ConverterParameter="MacOS_Theme_MenuItemIconOnly"> |
| 137 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
| 138 | + <Binding Source="{x:True}" /> |
| 139 | + <Binding Source="{x:False}" /> |
| 140 | + </MultiBinding> |
| 141 | + </ToolTip.ServiceEnabled> |
| 142 | + <ContentPresenter Name="PART_IconPresenter" |
| 143 | + Content="{TemplateBinding Icon}" /> |
| 144 | + <Panel Name="PART_ChevronPanel"> |
| 145 | + <Border Name="PART_ChevronBorder" Margin="3 0 0 0 "> |
| 146 | + <Path Name="PART_ChevronPath" |
| 147 | + Data="{StaticResource ChevronPath}" |
| 148 | + Width="{StaticResource TreeViewItemChevronSize}" |
| 149 | + Height="{StaticResource TreeViewItemChevronSize}" |
| 150 | + Fill="{TemplateBinding Foreground}" |
| 151 | + Stretch="Uniform" |
| 152 | + HorizontalAlignment="Center" |
| 153 | + VerticalAlignment="Center"> |
| 154 | + <Path.RenderTransform> |
| 155 | + <TransformGroup> |
| 156 | + <RotateTransform Angle="180" /> |
| 157 | + </TransformGroup> |
| 158 | + </Path.RenderTransform> |
| 159 | + <Path.IsVisible> |
| 160 | + <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
| 161 | + ConverterParameter="MacOS_Theme_MenuLabelBelowIcon"> |
| 162 | + <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
| 163 | + <Binding Source="{x:True}" /> |
| 164 | + <Binding Source="{x:False}" /> |
| 165 | + </MultiBinding> |
| 166 | + </Path.IsVisible> |
| 167 | + </Path> |
| 168 | + </Border> |
| 169 | + </Panel> |
| 170 | + </StackPanel> |
146 | 171 | </Panel>
|
147 |
| - </StackPanel> |
| 172 | + </Border> |
148 | 173 | <ContentPresenter Name="PART_HeaderPresenter"
|
149 | 174 | Content="{TemplateBinding Header}"
|
150 | 175 | ContentTemplate="{TemplateBinding HeaderTemplate}"
|
|
164 | 189 | <Binding Source="{x:True}" />
|
165 | 190 | </MultiBinding>
|
166 | 191 | </ContentPresenter.IsVisible>
|
167 |
| - <ContentPresenter.Margin> |
168 |
| - <MultiBinding Converter="{StaticResource ClassToChoiceConverter}" |
169 |
| - ConverterParameter="MacOS_Theme_MenuLabelBelowIcon"> |
170 |
| - <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=Menu}" Path="Classes" /> |
171 |
| - <Binding Source="{StaticResource MenuTextBelowIconMargin }" /> |
172 |
| - </MultiBinding> |
173 |
| - </ContentPresenter.Margin> |
174 | 192 | </ContentPresenter>
|
175 | 193 |
|
176 | 194 | </StackPanel>
|
|
229 | 247 | </Setter>
|
230 | 248 | </Style>
|
231 | 249 |
|
232 |
| - <Style Selector="^:open"> |
233 |
| - <Style Selector="^ /template/ Border#PART_LayoutRoot"> |
| 250 | + <Style Selector="^:open, ^:pointerover"> |
| 251 | + <Style Selector="^ /template/ Border#ItemActiveBackground"> |
234 | 252 | <Setter Property="Background" Value="{DynamicResource LayoutBackgroundMidBrush}" />
|
235 | 253 | </Style>
|
236 | 254 | </Style>
|
237 | 255 |
|
| 256 | + <Style Selector="^:pressed"> |
| 257 | + <Style Selector="^ /template/ Border#ItemActiveBackground"> |
| 258 | + <Setter Property="Background" Value="{DynamicResource LayoutBackgroundHighBrush}" /> |
| 259 | + </Style> |
| 260 | + </Style> |
| 261 | + |
| 262 | + <Style Selector="^:empty /template/ Border#ItemActiveBackground"> |
| 263 | + <Setter Property="Margin" Value="-13 -4" /> |
| 264 | + </Style> |
| 265 | + |
238 | 266 | <Style Selector="^:empty /template/ Panel#PART_ChevronPanel">
|
239 | 267 | <Setter Property="IsVisible" Value="False" />
|
240 | 268 | </Style>
|
|
0 commit comments