Fixes for GTK - still wrong

This commit is contained in:
2026-01-24 06:13:13 +00:00
parent 38c48fc99f
commit f1e3630d1b
11 changed files with 845 additions and 41 deletions

View File

@@ -310,12 +310,19 @@ public class LinuxApplication : IDisposable
Console.WriteLine("[LinuxApplication] Set initial UserAppTheme to Light based on system theme");
}
// Initialize GTK theme service and apply initial CSS
GtkThemeService.ApplyTheme();
// Handle user-initiated theme changes
((BindableObject)mauiApplication).PropertyChanged += (s, e) =>
{
if (e.PropertyName == "UserAppTheme")
{
Console.WriteLine($"[LinuxApplication] User theme changed to: {mauiApplication.UserAppTheme}");
// Apply GTK CSS for dialogs, menus, and window decorations
GtkThemeService.ApplyTheme();
LinuxViewRenderer.CurrentSkiaShell?.RefreshTheme();
// Force re-render the entire page to pick up theme changes