[eog/wip/cdavis/hdy-consistency: 2/2] application: Use libhandy dark style API




commit 2f157775f2c5e72cfd0b9de27402cb62feafab45
Author: Christopher Davis <christopherdavis gnome org>
Date:   Mon Feb 7 12:48:27 2022 -0800

    application: Use libhandy dark style API
    
    This brings support for the new dark style
    preference, and should be used over the old GTK
    API.

 src/eog-application.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/eog-application.c b/src/eog-application.c
index d26f0026..a9a509c9 100644
--- a/src/eog-application.c
+++ b/src/eog-application.c
@@ -273,8 +273,8 @@ eog_application_startup (GApplication *application)
        EogApplication *app = EOG_APPLICATION (application);
        GError *error = NULL;
        GFile *css_file;
-       GtkSettings *settings;
        GtkCssProvider *provider;
+  HdyStyleManager *style_manager;
 
        g_application_set_resource_base_path (application, "/org/gnome/eog");
        G_APPLICATION_CLASS (eog_application_parent_class)->startup (application);
@@ -311,10 +311,9 @@ eog_application_startup (GApplication *application)
        gtk_window_set_default_icon_name ("eog");
        g_set_application_name (_("Image Viewer"));
 
-       settings = gtk_settings_get_default ();
-       g_object_set (G_OBJECT (settings),
-                     "gtk-application-prefer-dark-theme", TRUE,
-                     NULL);
+       style_manager = hdy_style_manager_get_default ();
+       hdy_style_manager_set_color_scheme (style_manager,
+                                           HDY_COLOR_SCHEME_PREFER_DARK);
 
        eog_application_init_app_menu (app);
        eog_application_init_accelerators (GTK_APPLICATION (app));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]