Closed juhp closed 3 months ago
I checked with commands, if we can tell that the os is in dark mode or not, but
gsettings get org.gnome.desktop.interface gtk-theme
'Adwaita'
gsettings get org.gnome.desktop.interface gtk-theme
'Adwaita'
both in dark and NOT dark cases it is giving Adwaita theme
Is there any other way to tell if it's in dark mode ?
what if we just keep this in light
mode when initialize and let users decide what they need the dark mode in app or not. If they need dark mode in the app, they can just easily turn on the DARK THEME just enabling the checkbox in hamburger icon.
But there is definitely a way to check whether the system os is in dark mode or not !!
just for temporary code and it wan't able to check whether the system is in dark mode
settings = Gtk.Settings.get_default()
preferred_theme_name = settings.get_property('gtk-theme-name')
is_dark_mode = preferred_theme_name.endswith('-dark')
if is_dark_mode:
self.darktheme_checkbox.set_active(True)
settings = Gtk.Settings.get_default()
settings.set_property("gtk-application-prefer-dark-theme", True)
Should follow system light/dark mode and provide better style/sizing hopefully.