[libadwaita/wip/exalm/inspector: 3/7] style-manager: Anticipate system-supports-color-schemes changes
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/inspector: 3/7] style-manager: Anticipate system-supports-color-schemes changes
- Date: Sun, 26 Sep 2021 21:58:25 +0000 (UTC)
commit 1af8ad71f3ccd20161d8df8372c745e998a384d8
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon Sep 27 02:53:59 2021 +0500
style-manager: Anticipate system-supports-color-schemes changes
src/adw-style-manager.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-style-manager.c b/src/adw-style-manager.c
index 7a0057fc..9a4ab85c 100644
--- a/src/adw-style-manager.c
+++ b/src/adw-style-manager.c
@@ -209,6 +209,12 @@ update_dark (AdwStyleManager *self)
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DARK]);
}
+static void
+notify_system_supports_color_schemes_cb (AdwStyleManager *self)
+{
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SYSTEM_SUPPORTS_COLOR_SCHEMES]);
+}
+
static void
notify_high_contrast_cb (AdwStyleManager *self)
{
@@ -255,6 +261,11 @@ adw_style_manager_constructed (GObject *object)
self->settings = adw_settings_get_default ();
+ g_signal_connect_object (self->settings,
+ "notify::system-supports-color-schemes",
+ G_CALLBACK (notify_system_supports_color_schemes_cb),
+ self,
+ G_CONNECT_SWAPPED);
g_signal_connect_object (self->settings,
"notify::color-scheme",
G_CALLBACK (update_dark),
@@ -418,8 +429,6 @@ adw_style_manager_class_init (AdwStyleManagerClass *klass)
* color scheme preference. For example, applications might want to show a
* separate appearance switcher if it's set to `FALSE`.
*
- * It's only set at startup and cannot change its value later.
- *
* See [property@Adw.StyleManager:color-scheme].
*
* Since: 1.0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]