Skip to content

Linux: native GTK sidebar and theme-aware header icons - #322

Merged
Redth merged 2 commits into
mainfrom
redth/gtk-native-sidebar
Nov 20, 2026
Merged

Redth merged 2 commits into
mainfrom
redth/gtk-native-sidebar

Conversation

@Redth

@Redth Redth commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Follow-up to #320 for the Linux (GTK) head.

Doctor icon fix

The Doctor and Copilot header buttons used theme-specific PNGs. The Doctor PNG was picked once from IsDarkMode when the window was created and was never refreshed, so depending on how the theme was switched it could end up dark-on-dark or light-on-light.

Both buttons now use bundled GTK symbolic SVG icons (Resources/icons/*-symbolic.svg), registered on the icon theme search path. GTK recolors them for the active theme, so they always match the header bar. The custom PNGs and the theme-change rebuild logic are removed.

Native GTK sidebar

  • On Linux, the HTML sidebar is replaced by a native Gtk.ListBox with the navigation-sidebar style, hosted as a MAUI view (LinuxNavigationSidebar + handler) beside the BlazorWebView.
  • Groups show as dimmed headings, and items use symbolic icons. Everything follows the system/in-app theme (MAUI maps the app theme to GTK's prefer-dark setting).
  • Selection follows Blazor route changes, using the same longest-prefix/exact matching as the Windows NavigationView.
  • Clicking, keyboard, or accessibility (AT-SPI) selection navigates.

Native navigation fix (all native buttons on Unix)

MainLayout.OnNavigationRequested rejected routes using Uri.TryCreate(route, UriKind.Absolute, …). On Unix, /doctor parses as an absolute file:// URI, so native navigation requests were silently dropped on Linux. This included the existing Doctor header button. The guard now accepts only app-relative paths: a leading /, not //, and no \.

Other

  • Header bar widgets are now retained, to avoid GirCore toggle-ref GC crashes.
  • Icons: Font Awesome Free 6.5.1 glyphs (CC BY 4.0) and Octicons copilot-16 (MIT). Attribution is in Resources/icons/NOTICE.md.
  • mauidevflow-logs/ is now gitignored.

Verification (Linux GTK, Screenshot Mode)

  • Header icons render correctly when starting in dark, and after dark→light and light→dark switches.
  • Sidebar selection syncs when navigating from Blazor (/secrets/publish selects only Publish).
  • Selecting rows natively navigates to Certificates and .NET SDK Manager; the Doctor button opens Environment Doctor.

Native GTK sidebar in light mode
Native GTK sidebar in dark mode

Known limitation: the sidebar width is fixed at 250px (not yet resizable or persisted like on Windows).

Redth and others added 2 commits November 20, 2026 13:31
- Replace theme-specific PNG header icons (Copilot, Doctor) with bundled
  GTK symbolic SVG icons that GTK recolors for the active theme, fixing the
  Doctor icon disappearing after light/dark switches.
- Add a native GTK navigation-sidebar ListBox beside the BlazorWebView and
  hide the HTML sidebar on Linux; selection follows Blazor route changes.
- Accept native navigation requests on Unix: Uri.TryCreate treated rooted
  routes such as /doctor as absolute file URIs and rejected them.
- Retain header bar widgets to avoid GirCore toggle-ref GC crashes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Redth
Redth merged commit 5158a82 into main Nov 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant