From b19f073b27daec650e1b399d8f388e341857d477 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Fri, 11 Sep 2026 11:19:13 +0000 Subject: [PATCH] fluent 2 - fix commandbar style --- .../CommandBar/CommandBarFirstLookPage.xaml | 9 +- .../Accents/FluentControlResources.xaml | 118 +++ .../Controls/CommandBar.xaml | 694 +++++++++++------- 3 files changed, 570 insertions(+), 251 deletions(-) diff --git a/samples/ControlCatalog/Pages/CommandBar/CommandBarFirstLookPage.xaml b/samples/ControlCatalog/Pages/CommandBar/CommandBarFirstLookPage.xaml index 60c23d9c64..11f8ecc16f 100644 --- a/samples/ControlCatalog/Pages/CommandBar/CommandBarFirstLookPage.xaml +++ b/samples/ControlCatalog/Pages/CommandBar/CommandBarFirstLookPage.xaml @@ -19,25 +19,25 @@ Foreground="{DynamicResource SystemControlHighlightAccentBrush}" /> + Opacity="0.7" TextWrapping="Wrap" /> + Opacity="0.7" TextWrapping="Wrap" /> + Opacity="0.7" TextWrapping="Wrap" /> + Opacity="0.7" TextWrapping="Wrap" /> @@ -86,7 +86,6 @@ diff --git a/src/Avalonia.Themes.Fluent2/Accents/FluentControlResources.xaml b/src/Avalonia.Themes.Fluent2/Accents/FluentControlResources.xaml index 8f0844c958..8503269e82 100644 --- a/src/Avalonia.Themes.Fluent2/Accents/FluentControlResources.xaml +++ b/src/Avalonia.Themes.Fluent2/Accents/FluentControlResources.xaml @@ -117,6 +117,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 64 1 @@ -835,6 +894,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #FFC58AF9 diff --git a/src/Avalonia.Themes.Fluent2/Controls/CommandBar.xaml b/src/Avalonia.Themes.Fluent2/Controls/CommandBar.xaml index f5a0b73d89..d55c00f60b 100644 --- a/src/Avalonia.Themes.Fluent2/Controls/CommandBar.xaml +++ b/src/Avalonia.Themes.Fluent2/Controls/CommandBar.xaml @@ -26,26 +26,64 @@ + 48 + 2,6,6,6 + 2,6,2,6 + 2,6,2,22 + 12,16,0,10 + 8,16,12,10 + 64 + 48 + 16 + 0,16,0,2 + 12 + 2,0,2,8 + 0,5,0,8 + 4,0,4,0 + 0 + 2,8,2,8 + 0,4,0,4 + 1 + 1 + 0.5 + 1 + 160 + 240 + 480 + 198 + 1 + 0,0,0,1 + 0,1,0,0 + 0 + 0 + 6 + 0,4,0,4 + 14,23,14,0 + + AppBarToggleButton_themeresources.xaml, AppBarSeparator_themeresources.xaml (via Uno.UI.FluentTheme.v2). + AppBar idiom: transparent bar (CommandBarBackground = ControlFillColorTransparent; the open state uses + AcrylicInAppFillColorDefault with a 1px CardStrokeColorDefaultSolid border), subtle-fill command pills + with ControlCornerRadius and an 83ms fill cross-fade, 16px icons (AppBarButtonContentHeight) with 12px + labels, checked toggles on AccentFillColorDefault with TextOnAccent text, and 1px + DividerStrokeColorDefault separators (AppBarSeparatorMargin 2,8). WinUI's default closed CommandBar has + no bottom divider, so none is drawn here. The v1 SystemControl* brush references were re-pointed to the + Fluent 2 tokens in this file; no shared-file keys are defined for these controls. --> - - + + + + + + + + + - - - - + - + @@ -69,27 +109,39 @@ + + + + + + - - - - + + + + + @@ -100,114 +152,153 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + + - + + - + + - + - + - - - + + + - - - + + + + + + + + + + - - - - + + + + + @@ -218,173 +309,283 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + + - + + - - + + - - + - - - - - + + + + + + + + + + + + + + + + + + + - + - + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1px DividerStrokeColorDefault, AppBarSeparatorMargin 2,8, corner radius 0.5) --> - - - + + + - + - - - - - - + + - - + + + - - - - - - @@ -427,33 +622,40 @@ - + + SurfaceStrokeColorFlyout 1px border, OverlayCornerRadius, min width 160) --> - + Padding="{DynamicResource CommandBarOverflowPresenterBorderPadding}" + MinWidth="{DynamicResource CommandBarOverflowMinWidth}" + MaxWidth="{DynamicResource CommandBarOverflowMaxWidth}"> + + + + @@ -468,7 +670,7 @@ + a layout jump; the rest-state border is transparent). -->