[totem/wip/hadess/old-channel-icon: 1/2] icon-helpers: Set dark UI the same way as the main player




commit 99ae25b2273f89e87e1b4f430ab516061fc84c50
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Apr 1 11:08:47 2022 +0200

    icon-helpers: Set dark UI the same way as the main player
    
    Otherwise we're testing a different codepath to the main application.

 src/meson.build  | 3 ++-
 src/test-icons.c | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index bc371baf3..6446e603e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -256,7 +256,8 @@ executable(
   test_icons_sources,
   dependencies: [
     libtotem_player_dep,
-    libbacon_video_widget_dep
+    libbacon_video_widget_dep,
+    hdy_dep,
   ],
   c_args: totem_common_cflags
 )
diff --git a/src/test-icons.c b/src/test-icons.c
index 36dee8276..9c3d2892a 100644
--- a/src/test-icons.c
+++ b/src/test-icons.c
@@ -1,5 +1,6 @@
 #include <gtk/gtk.h>
 #include <grilo.h>
+#include <libhandy-1/handy.h>
 #include <icon-helpers.h>
 
 typedef struct {
@@ -95,18 +96,20 @@ static const char *labels[] = {
 
 int main (int argc, char **argv)
 {
+       HdyStyleManager *style_manager;
        GtkWidget *window, *box, *scroll;
        GtkStyleContext *context;
        GtkWidget *images[NUM_IMAGES];
        GObject *object;
-       GtkSettings *gtk_settings;
        guint i;
        gboolean tmp;
 
        gtk_init (&argc, &argv);
        grl_init (&argc, &argv);
-       gtk_settings = gtk_settings_get_default ();
-       g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme", TRUE, NULL);
+
+       hdy_init ();
+       style_manager = hdy_style_manager_get_default ();
+       hdy_style_manager_set_color_scheme (style_manager, HDY_COLOR_SCHEME_FORCE_DARK);
 
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
        totem_grilo_setup_icons ();


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