diff options
author | Robert Tari <robert@tari.in> | 2023-07-14 06:01:35 +0200 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2023-07-14 06:01:35 +0200 |
commit | 71e3215d550fc99f9c9b9c618a84690914202c43 (patch) | |
tree | ce65d32a8b14d091951abc9396dddc33a1193e87 /ayatanawebmail | |
parent | 41b1b63ae1fb2aca83753056942ee2a31953bb1a (diff) | |
download | ayatana-webmail-71e3215d550fc99f9c9b9c618a84690914202c43.tar.gz ayatana-webmail-71e3215d550fc99f9c9b9c618a84690914202c43.tar.bz2 ayatana-webmail-71e3215d550fc99f9c9b9c618a84690914202c43.zip |
ayatanawebmail/application.py: Add colour scheme handler
Diffstat (limited to 'ayatanawebmail')
-rwxr-xr-x | ayatanawebmail/application.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ayatanawebmail/application.py b/ayatanawebmail/application.py index 72bfd55..e6abf46 100755 --- a/ayatanawebmail/application.py +++ b/ayatanawebmail/application.py @@ -484,6 +484,10 @@ class AyatanaWebmail(object): self.bNoNetwork = True self.oMessagingMenu = MessagingMenu(self.onMenuItemClicked, self.openDialog, self.updateMessageAges, self.fnCheckNetwork) + self.pGnomeSettings = Gio.Settings.new ('org.gnome.desktop.interface') + self.pGnomeSettings.connect ('changed::color-scheme', self.onColorSchemeChanged) + self.onColorSchemeChanged (self.pGnomeSettings, 'color-scheme') + self.initKeyring() self.initConfig() DBusGMainLoop(set_as_default=True) @@ -507,6 +511,12 @@ class AyatanaWebmail(object): except KeyboardInterrupt: self.close(0) + def onColorSchemeChanged (self, pSettings, sKey): + + sColorScheme = pSettings.get_string (sKey) + bDark = (sColorScheme == 'prefer-dark') + Gtk.Settings.get_default().props.gtk_application_prefer_dark_theme = bDark + def onPrepareForSleep(self, bGoing): if not bGoing: |