aboutsummaryrefslogtreecommitdiff
path: root/ayatanawebmail
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2023-07-14 06:01:35 +0200
committerRobert Tari <robert@tari.in>2023-07-14 06:01:35 +0200
commit71e3215d550fc99f9c9b9c618a84690914202c43 (patch)
treece65d32a8b14d091951abc9396dddc33a1193e87 /ayatanawebmail
parent41b1b63ae1fb2aca83753056942ee2a31953bb1a (diff)
downloadayatana-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-xayatanawebmail/application.py10
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: