application: Support dark style preference
Depend on libhandy 1.5.0.
This commit is contained in:
+1
-1
@@ -164,7 +164,7 @@ libedataserver_dep = dependency('libedataserver-1.2', version: '>= 3.17.1')
|
||||
libecal_dep = dependency('libecal-2.0', version: '>= 3.33.2')
|
||||
libsoup_dep = dependency('libsoup-2.4')
|
||||
libdazzle_dep = dependency('libdazzle-1.0', version: '>= 3.33.1')
|
||||
libhandy_dep = dependency('libhandy-1', version: '>= 1.0.0')
|
||||
libhandy_dep = dependency('libhandy-1', version: '>= 1.5.0')
|
||||
glib_dep = dependency('glib-2.0', version: '>= 2.67.5')
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 3.22.20')
|
||||
gio_dep = dependency('gio-2.0', version: '>= 2.58.0')
|
||||
|
||||
@@ -67,10 +67,12 @@ on_night_light_proxy_properties_changed_cb (GcalNightLightMonitor *self,
|
||||
activev = g_dbus_proxy_get_cached_property (proxy, "NightLightActive");
|
||||
active = g_variant_get_boolean (activev);
|
||||
|
||||
g_object_set (gtk_settings_get_default (),
|
||||
"gtk-application-prefer-dark-theme",
|
||||
active,
|
||||
NULL);
|
||||
if (active)
|
||||
hdy_style_manager_set_color_scheme (hdy_style_manager_get_default (),
|
||||
HDY_COLOR_SCHEME_PREFER_DARK);
|
||||
else
|
||||
hdy_style_manager_set_color_scheme (hdy_style_manager_get_default (),
|
||||
HDY_COLOR_SCHEME_PREFER_LIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -362,6 +362,9 @@ gcal_application_startup (GApplication *app)
|
||||
/* initialize libhandy */
|
||||
hdy_init();
|
||||
|
||||
hdy_style_manager_set_color_scheme (hdy_style_manager_get_default (),
|
||||
HDY_COLOR_SCHEME_PREFER_LIGHT);
|
||||
|
||||
/* Startup the manager */
|
||||
gcal_context_startup (self->context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user