fix: respect sidebar decoration color in macos window (#587)#588
fix: respect sidebar decoration color in macos window (#587)#588rubenRoehner wants to merge 1 commit intomacosui:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes macOS sidebar background painting in MacosWindow by honoring Sidebar.decoration.color when provided and otherwise preserving native transparency (to keep blur/tint behavior), addressing issue #587. It also bumps the package version and documents the fix in the changelog.
Changes:
- Update
MacosWindowsidebar background logic to useSidebar.decoration.colorwhen set, and keep macOS sidebar transparent by default (with a web fallback totheme.canvasColor). - Remove the hard-coded black fill that caused visible dark strips when wallpaper tinting was disabled/light mode was active.
- Bump version to
2.2.3and add a2.2.3changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pubspec.yaml | Version bump to 2.2.3. |
| lib/src/layout/window.dart | Adjust sidebar background painting rules and remove hard-coded black fill. |
| CHANGELOG.md | Document the sidebar background fix for 2.2.3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| (sidebar.decoration ?? const BoxDecoration()) | ||
| .copyWith( | ||
| // Only paint if the caller set a color; null preserves native transparency. | ||
| color: sidebarBackgroundColor, | ||
| ), |
There was a problem hiding this comment.
In the non-web branch, AnimatedContainer already paints sidebarBackgroundColor via its color:. The new DecoratedBox also applies sidebarBackgroundColor as the BoxDecoration.color, which will effectively paint the color twice when the caller provides a semi-transparent Sidebar.decoration.color (making it appear darker than requested). Consider having only a single widget paint the background color (e.g., move the sidebar.decoration/color onto AnimatedContainer.decoration and drop the inner color paint) so opacity is applied exactly once.
| (sidebar.decoration ?? const BoxDecoration()) | |
| .copyWith( | |
| // Only paint if the caller set a color; null preserves native transparency. | |
| color: sidebarBackgroundColor, | |
| ), | |
| sidebar.decoration ?? const BoxDecoration(), |
| // Respect the sidebar color override from parent if one is given | ||
| if (sidebar?.decoration?.color != null) { | ||
| sidebarBackgroundColor = sidebar!.decoration!.color!; | ||
| } else { | ||
| sidebarBackgroundColor = MacosColors.transparent; | ||
| } | ||
| sidebarBackgroundColor = | ||
| sidebar?.decoration?.color ?? (kIsWeb ? theme.canvasColor : null); |
There was a problem hiding this comment.
This change introduces new sidebar background behavior across platforms (transparent on macOS unless Sidebar.decoration.color is set; theme.canvasColor on web). Since test/layout/window_test.dart already covers MacosWindow/Sidebar, it would be good to add a widget test asserting the expected background paint behavior for (1) no decoration color vs (2) a provided decoration color, to prevent regressions like the black strip issue.
Fixes #587.
Sidebar.decoration.colorwhen provided; otherwise keep the macOS sidebar transparent to preserve blur/tint, and usetheme.canvasColoron web.Pre-launch checklist: