summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-04-01 11:08:47 +0200
committerBastien Nocera <hadess@hadess.net>2022-04-01 11:09:39 +0200
commit99ae25b2273f89e87e1b4f430ab516061fc84c50 (patch)
treec0bd1a7fe5db6d6939ff556a599418cd584eccac
parentc46aad13a5fcab08241a70d841aba8ecc12754bf (diff)
downloadtotem-99ae25b2273f89e87e1b4f430ab516061fc84c50.tar.gz
icon-helpers: Set dark UI the same way as the main player
Otherwise we're testing a different codepath to the main application.
-rw-r--r--src/meson.build3
-rw-r--r--src/test-icons.c9
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 ();