Philipp Hörist pushed to branch master at gajim / gajim


Commits:
32f2bcaa by André Apitzsch at 2022-06-20T19:51:03+02:00
fix: SystemStyleListener: Fix handling of color scheme states

Supported color scheme states/values are
  0: No preference
  1: Prefer dark appearance
  2: Prefer light appearance

https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Fixes #10996.

- - - - -


1 changed file:

- gajim/common/dbus/system_style.py


Changes:

=====================================
gajim/common/dbus/system_style.py
=====================================
@@ -16,7 +16,6 @@
 
 from typing import Any
 from typing import Callable
-from typing import cast
 from typing import Optional
 
 import sys
@@ -65,7 +64,7 @@ def read_color_scheme(self) -> None:
                 Gio.DBusCallFlags.NO_AUTO_START,
                 -1,
                 None)
-            (self._prefer_dark,) = cast(tuple[bool], result)
+            self._prefer_dark = result[0] == 1
         except GLib.Error as error:
             log.error('Couldn’t read the color-scheme setting: %s',
                       error.message)
@@ -84,7 +83,7 @@ def _signal_setting_changed(self,
         namespace, name, value = parameters
         if (namespace == 'org.freedesktop.appearance' and
                 name == 'color-scheme'):
-            self._prefer_dark = (value == 1)
+            self._prefer_dark = value == 1
             self._callback()
             app.ged.raise_event(StyleChanged())
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/32f2bcaa13e8d404444e75e2dd890f78a5f4cfa0

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/32f2bcaa13e8d404444e75e2dd890f78a5f4cfa0
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to