macOS Traffic Light and Tab Header Vertical Alignment (Browser Theme)#1054
Merged
wieslawsoltes merged 5 commits intomasterfrom Feb 18, 2026
Merged
Conversation
This was referenced Feb 23, 2026
Closed
This was referenced Mar 2, 2026
Closed
This was referenced Mar 9, 2026
Closed
This was referenced Mar 18, 2026
This was referenced Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary: macOS Traffic Light and Tab Header Vertical Alignment (Browser Theme)
Branch
fix/macos-hostwindow-trafficlights-alignmentProblem Statement
The Browser theme sample on macOS showed two related layout issues:
While attempting to move traffic lights down by increasing titlebar height hints, the document tabs in floating host windows shifted downward, causing a secondary regression.
Root Cause Analysis
Host window regression source
HostWindowtemplates applyWindowDecorationMargindirectly to content containers. On macOS,WindowDecorationMargin.Topis affected by titlebar/chrome hints.When
ExtendClientAreaTitleBarHeightHintis raised for host windows, the top decoration margin increases, and content (including tab strip) is pushed down. This created the observed “tabs moved down” issue in floating host windows.Relevant paths:
src/Dock.Avalonia.Themes.Browser/Styles/Controls/HostWindow.axamlMargin="{TemplateBinding WindowDecorationMargin}"Margin="{Binding $parent[HostWindow].WindowDecorationMargin}"Document tab text misalignment source
The tab template set
VerticalContentAlignment="Center"onDocumentTabStripItem, but the template itself did not consume it for the tab-content root. Browser sample header template also used fixedPadding="2"instead of theme tokenized padding that can be platform-tuned.What Changed
Commit 1
fluent: honor vertical content alignment in document tab item templateFile:
src/Dock.Avalonia.Themes.Fluent/Controls/DocumentTabStripItem.axamlChanges:
DockableControl.VerticalAlignment="{TemplateBinding VerticalContentAlignment}"Outcome:
DocumentTabStripItem.VerticalContentAlignment.Commit 4
fluent: keep single root vertical alignment binding for document tabsFile:
src/Dock.Avalonia.Themes.Fluent/Controls/DocumentTabStripItem.axamlChanges:
VerticalAlignmentbindings from innerStackPanel/ContentPresenternodes.DockableControl).Outcome:
Commit 2
browser-theme: add macOS host chrome hints and platform header paddingFiles:
src/Dock.Avalonia.Themes.Browser/Styles/BrowserTabAccents.axamlsrc/Dock.Avalonia.Themes.Browser/Styles/Controls/HostWindow.axamlChanges:
DockHostWindowChromeHintstoken:PreferSystemChromeDefault, PreferSystemChrome, OSXThickTitleBarHostWindow.ExtendClientAreaChromeHintsto the token.ExtendClientAreaTitleBarHeightHintat0for host windows (prevents margin-driven content shift).DockHeaderContentPaddingintoOnPlatformtoken:22,1,2,0Outcome:
Commit 3
browser-sample: align header padding and macOS titlebar chrome settingsFiles:
samples/BrowserTabTheme/App.axamlsamples/BrowserTabTheme/MainWindow.axamlChanges:
Padding="{DynamicResource DockHeaderContentPadding}"ExtendClientAreaTitleBarHeightHint="32"ExtendClientAreaChromeHints="Default, PreferSystemChrome, OSXThickTitleBar"Outcome:
Why This Is the Correct Fix
WindowDecorationMargincoupling.Validation
Build
dotnet build src/Dock.Avalonia.Themes.Browser/Dock.Avalonia.Themes.Browser.csprojpassed.dotnet build samples/BrowserTabTheme/BrowserTabTheme.csprojpassed.Tests
dotnet test tests/Dock.Avalonia.Themes.UnitTests/Dock.Avalonia.Themes.UnitTests.csproj --filter "ThemeManager|ThemeDensity|DocumentTabStripItem"passed.Note:
Risk / Compatibility Notes
OSXThickTitleBaris only applied viaOnPlatformfor macOS host windows.PreferSystemChrome.0) to avoid regressions in content positioning.Manual QA Checklist (macOS)