application: Support dark style preference
Depend on libhandy 1.5.0.
This commit is contained in:
@@ -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