If theme.LightTheme() is deprecated #3575
-
How to achieve for fyne app to change theme based on the underling system theme. i was doing something like this
But i get a warning that the this will be deprecated in 3.0. Is there an OOB solution to autochaging dark/light based on system default? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
We already do switch between light/dark theme automatically on most platforms. Version v2.3.0 added support for the feature on Linux (as long as the desktop supports the FreeDesktop Dark Theme Preference). We already had support for macOS/Windows before as far as I know. Is there any platform on which it doesn’t work for you? For changing these settings, I personally used https://pkg.go.dev/fyne.io/fyne/v2/cmd/fyne_settings/settings#Settings.LoadAppearanceScreen in Rymdport (https://github.com/Jacalz/rymdport/blob/563f716f967de28830799cafd91d5c51934915c3/internal/ui/settings.go#L199) to integrate part of the fyne_settings application. I am not entirely sure that I would recommend it in all cases though because the downside is that it will change the settings for all Fyne applications. For containerised distribution (Flatpak, Snap and such) it is not problem because it can’t access the rest of the file system. |
Beta Was this translation helpful? Give feedback.
We already do switch between light/dark theme automatically on most platforms. Version v2.3.0 added support for the feature on Linux (as long as the desktop supports the FreeDesktop Dark Theme Preference). We already had support for macOS/Windows before as far as I know. Is there any platform on which it doesn’t work for you?
For changing these settings, I personally used https://pkg.go.dev/fyne.io/fyne/v2/cmd/fyne_settings/settings#Settings.LoadAppearanceScreen in Rymdport (https://github.com/Jacalz/rymdport/blob/563f716f967de28830799cafd91d5c51934915c3/internal/ui/settings.go#L199) to integrate part of the fyne_settings application. I am not entirely sure that I would recommend it in al…