|
24 | 24 | <Setter Property="VerticalAlignment" Value="Stretch" /> |
25 | 25 | <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
26 | 26 | <Setter Property="FontWeight" Value="Normal" /> |
27 | | - <Setter Property="Width" Value="40" /> |
28 | | - <Setter Property="Height" Value="40" /> |
| 27 | + <Setter Property="Width" Value="NaN" /> |
29 | 28 | <Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" /> |
30 | 29 | <Setter Property="FocusVisualMargin" Value="0,0,0,2" /> |
31 | 30 | <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" /> |
|
46 | 45 | BorderThickness="{TemplateBinding BorderThickness}" |
47 | 46 | CornerRadius="{TemplateBinding CornerRadius}" /> |
48 | 47 |
|
49 | | - <Grid x:Name="ContentRoot"> |
| 48 | + <Grid x:Name="ContentRoot" MinWidth="40"> |
50 | 49 | <Grid.ColumnDefinitions> |
51 | 50 | <ColumnDefinition Width="*" /> |
52 | 51 | <ColumnDefinition Width="Auto" /> |
53 | 52 | <ColumnDefinition Width="Auto" /> |
54 | 53 | </Grid.ColumnDefinitions> |
55 | | - <Viewbox |
56 | | - x:Name="ContentViewbox" |
57 | | - Height="16" |
58 | | - HorizontalAlignment="Stretch"> |
59 | | - <ui:ContentPresenterEx |
60 | | - x:Name="Content" |
61 | | - Content="{TemplateBinding Icon}" |
62 | | - Foreground="{TemplateBinding Foreground}" /> |
63 | | - </Viewbox> |
| 54 | + <Grid x:Name="IconAndLabelPanel" VerticalAlignment="Center"> |
| 55 | + <Grid.RowDefinitions> |
| 56 | + <RowDefinition Height="*" /> |
| 57 | + <RowDefinition Height="Auto" /> |
| 58 | + </Grid.RowDefinitions> |
| 59 | + <Viewbox x:Name="ContentViewbox" Height="16"> |
| 60 | + <ui:ContentPresenterEx |
| 61 | + x:Name="Content" |
| 62 | + Content="{TemplateBinding Icon}" |
| 63 | + Foreground="{TemplateBinding Foreground}"/> |
| 64 | + </Viewbox> |
| 65 | + <TextBlock x:Name="TextLabel" |
| 66 | + Grid.Row="1" |
| 67 | + Text="{TemplateBinding Label}" |
| 68 | + Style="{DynamicResource CaptionTextBlockStyle}" |
| 69 | + Foreground="{TemplateBinding Foreground}" |
| 70 | + FontFamily="{TemplateBinding FontFamily}" |
| 71 | + TextAlignment="Center" |
| 72 | + TextTrimming="CharacterEllipsis" |
| 73 | + TextWrapping="Wrap" |
| 74 | + HorizontalAlignment="Center" |
| 75 | + Margin="0,6,0,2" |
| 76 | + Visibility="Collapsed" /> |
| 77 | + </Grid> |
64 | 78 | <TextBlock |
65 | 79 | x:Name="OverflowTextLabel" |
66 | 80 | Margin="12,0,12,0" |
|
73 | 87 | Text="{TemplateBinding Label}" |
74 | 88 | TextAlignment="Left" |
75 | 89 | TextWrapping="NoWrap" |
| 90 | + TextTrimming="CharacterEllipsis" |
76 | 91 | Visibility="Collapsed" /> |
77 | 92 | <TextBlock |
78 | 93 | x:Name="KeyboardAcceleratorTextLabel" |
|
90 | 105 | Grid.Column="2" |
91 | 106 | Margin="12,0,12,0" |
92 | 107 | VerticalAlignment="Center" |
93 | | - FontFamily="{DynamicResource FluentSystemIcons}" |
| 108 | + FontFamily="{DynamicResource SymbolThemeFontFamily}" |
94 | 109 | FontSize="12" |
95 | 110 | Foreground="{DynamicResource CommandBarFlyoutAppBarButtonSubItemChevronForeground}" |
96 | | - Glyph="" |
| 111 | + Glyph="" |
97 | 112 | Visibility="Collapsed" /> |
98 | 113 | </Grid> |
99 | 114 | <VisualStateManager.VisualStateGroups> |
|
137 | 152 | <VisualState x:Name="NoFlyout" /> |
138 | 153 | <VisualState x:Name="HasFlyout" /> |
139 | 154 | </VisualStateGroup> |
| 155 | + <VisualStateGroup x:Name="PrimaryLabelStates"> |
| 156 | + <ui:VisualStateGroupListener.Listener> |
| 157 | + <ui:VisualStateGroupListener x:Name="PrimaryLabelStatesListener" /> |
| 158 | + </ui:VisualStateGroupListener.Listener> |
| 159 | + <VisualState x:Name="NoPrimaryLabels" /> |
| 160 | + <VisualState x:Name="HasPrimaryLabels" /> |
| 161 | + </VisualStateGroup> |
140 | 162 | </VisualStateManager.VisualStateGroups> |
141 | 163 | </Grid> |
142 | 164 | <ControlTemplate.Triggers> |
|
154 | 176 | <Setter TargetName="ContentRoot" Property="MinHeight" Value="0" /> |
155 | 177 | <Setter TargetName="ContentRoot" Property="Width" Value="NaN" /> |
156 | 178 | <Setter TargetName="ContentViewbox" Property="Visibility" Value="Collapsed" /> |
| 179 | + <Setter TargetName="TextLabel" Property="Visibility" Value="Collapsed" /> |
157 | 180 | <Setter TargetName="OverflowTextLabel" Property="Visibility" Value="Visible" /> |
158 | 181 | <Setter TargetName="OverflowTextLabel" Property="Margin" Value="39,0,12,0" /> |
159 | 182 | </Trigger> |
|
166 | 189 | <Setter TargetName="ContentViewbox" Property="Width" Value="16" /> |
167 | 190 | <Setter TargetName="ContentViewbox" Property="Height" Value="16" /> |
168 | 191 | <Setter TargetName="ContentViewbox" Property="Margin" Value="12,0,12,0" /> |
| 192 | + <Setter TargetName="TextLabel" Property="Visibility" Value="Collapsed" /> |
169 | 193 | <Setter TargetName="OverflowTextLabel" Property="Visibility" Value="Visible" /> |
170 | 194 | <Setter TargetName="OverflowTextLabel" Property="Margin" Value="39,0,12,0" /> |
171 | 195 | </Trigger> |
|
178 | 202 | <Setter TargetName="ContentViewbox" Property="Width" Value="16" /> |
179 | 203 | <Setter TargetName="ContentViewbox" Property="Height" Value="16" /> |
180 | 204 | <Setter TargetName="ContentViewbox" Property="Margin" Value="39,0,12,0" /> |
| 205 | + <Setter TargetName="TextLabel" Property="Visibility" Value="Collapsed" /> |
181 | 206 | <Setter TargetName="OverflowTextLabel" Property="Visibility" Value="Visible" /> |
182 | 207 | <Setter TargetName="OverflowTextLabel" Property="Margin" Value="67,0,12,0" /> |
183 | 208 | </Trigger> |
|
187 | 212 | <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="PointerOver"> |
188 | 213 | <Setter TargetName="AppBarButtonInnerBorder" Property="Background" Value="{DynamicResource CommandBarFlyoutAppBarButtonBackgroundPointerOver}" /> |
189 | 214 | <Setter TargetName="Content" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundPointerOver}" /> |
| 215 | + <Setter TargetName="TextLabel" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundPointerOver}" /> |
190 | 216 | </Trigger> |
191 | 217 | <!-- Pressed --> |
192 | 218 | <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="Pressed"> |
193 | 219 | <Setter TargetName="AppBarButtonInnerBorder" Property="Background" Value="{DynamicResource CommandBarFlyoutAppBarButtonBackgroundPressed}" /> |
194 | 220 | <Setter TargetName="Content" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundPressed}" /> |
| 221 | + <Setter TargetName="TextLabel" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundPressed}" /> |
195 | 222 | </Trigger> |
196 | 223 | <!-- Disabled --> |
197 | 224 | <Trigger SourceName="CommonStatesListener" Property="CurrentStateName" Value="Disabled"> |
198 | 225 | <Setter TargetName="AppBarButtonInnerBorder" Property="Background" Value="{DynamicResource CommandBarFlyoutAppBarButtonBackgroundDisabled}" /> |
199 | 226 | <Setter TargetName="Content" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundDisabled}" /> |
| 227 | + <Setter TargetName="TextLabel" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundDisabled}" /> |
200 | 228 | <Setter TargetName="OverflowTextLabel" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundDisabled}" /> |
201 | 229 | <Setter TargetName="KeyboardAcceleratorTextLabel" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonForegroundDisabled}" /> |
202 | 230 | <Setter TargetName="SubItemChevron" Property="Foreground" Value="{DynamicResource CommandBarFlyoutAppBarButtonSubItemChevronDisabledForeground}" /> |
|
234 | 262 | <Trigger SourceName="FlyoutStatesListener" Property="CurrentStateName" Value="HasFlyout"> |
235 | 263 | <Setter TargetName="SubItemChevron" Property="Visibility" Value="{DynamicResource AppBarButtonHasFlyoutChevronVisibility}" /> |
236 | 264 | </Trigger> |
| 265 | + <!-- HasPrimaryLabels --> |
| 266 | + <Trigger SourceName="PrimaryLabelStatesListener" Property="CurrentStateName" Value="HasPrimaryLabels"> |
| 267 | + <Setter TargetName="IconAndLabelPanel" Property="Margin" Value="0,9,0,0" /> |
| 268 | + <Setter TargetName="IconAndLabelPanel" Property="VerticalAlignment" Value="Top" /> |
| 269 | + <Setter TargetName="IconAndLabelPanel" Property="Width" Value="60" /> |
| 270 | + <Setter TargetName="TextLabel" Property="Visibility" Value="Visible" /> |
| 271 | + </Trigger> |
237 | 272 | </ControlTemplate.Triggers> |
238 | 273 | </ControlTemplate> |
239 | 274 | </Setter.Value> |
|
1096 | 1131 | <Grid> |
1097 | 1132 | <Grid.ColumnDefinitions> |
1098 | 1133 | <ColumnDefinition Width="*" /> |
1099 | | - <ColumnDefinition Width="Auto" /> |
| 1134 | + <ColumnDefinition Width="Auto" MinWidth="3" /> |
1100 | 1135 | </Grid.ColumnDefinitions> |
1101 | 1136 | <primitives:CommandBarPanel |
1102 | 1137 | x:Name="PART_ToolBarPanel" |
1103 | 1138 | Grid.Column="0" |
1104 | | - Height="40" |
1105 | 1139 | Margin="3,3,0,3" |
1106 | 1140 | HorizontalAlignment="Left" |
1107 | 1141 | IsItemsHost="true" |
|
1123 | 1157 | x:Name="EllipsisIcon" |
1124 | 1158 | HorizontalAlignment="Center" |
1125 | 1159 | VerticalAlignment="Center" |
1126 | | - FontFamily="{DynamicResource FluentSystemIcons}" |
| 1160 | + FontFamily="{DynamicResource SymbolThemeFontFamily}" |
1127 | 1161 | FontSize="16" |
1128 | | - Glyph="" /> |
| 1162 | + Glyph="" /> |
1129 | 1163 | </ToggleButton> |
1130 | 1164 | </Grid> |
1131 | 1165 | </Border> |
|
1304 | 1338 | <Setter Property="BorderBrush" Value="{DynamicResource CommandBarFlyoutBorderBrush}" /> |
1305 | 1339 | <Setter Property="BorderThickness" Value="{DynamicResource CommandBarFlyoutBorderThemeThickness}" /> |
1306 | 1340 | <Setter Property="IsTabStop" Value="False" /> |
1307 | | - <Setter Property="VerticalAlignment" Value="Top" /> |
| 1341 | + <Setter Property="VerticalAlignment" Value="Stretch" /> |
1308 | 1342 | <Setter Property="HorizontalAlignment" Value="Left" /> |
1309 | 1343 | <Setter Property="HorizontalContentAlignment" Value="Left" /> |
1310 | | - <Setter Property="VerticalContentAlignment" Value="Top" /> |
| 1344 | + <Setter Property="VerticalContentAlignment" Value="Stretch" /> |
1311 | 1345 | <Setter Property="DefaultLabelPosition" Value="Collapsed" /> |
1312 | 1346 | <Setter Property="MaxWidth" Value="440" /> |
1313 | | - <Setter Property="Height" Value="48" /> |
1314 | 1347 | <Setter Property="IsDynamicOverflowEnabled" Value="True" /> |
1315 | 1348 | <Setter Property="CommandBarOverflowPresenterStyle" Value="{StaticResource CommandBarFlyoutCommandBarOverflowPresenterStyle}" /> |
1316 | 1349 | <Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" /> |
|
0 commit comments