|
| 1 | +diff --git a/meson.build b/meson.build |
| 2 | +index de9cbfa850..647f617605 100644 |
| 3 | +--- a/meson.build |
| 4 | ++++ b/meson.build |
| 5 | +@@ -92,6 +92,7 @@ iso_codes_dep = dependency('iso-codes', version: '>= 0.35') |
| 6 | + json_glib_dep = dependency('json-glib-1.0', version: '>= 1.6') |
| 7 | + libarchive_dep = dependency('libarchive') |
| 8 | + libdazzle_dep = dependency('libdazzle-1.0', version: '>= 3.37.1') |
| 9 | ++libgranite_dep = dependency('granite', version: '>= 6.0.0') |
| 10 | + libhandy_dep = dependency('libhandy-1', version: '>= 1.1.0') |
| 11 | + libsecret_dep = dependency('libsecret-1', version: '>= 0.19.0') |
| 12 | + libsoup_dep = dependency('libsoup-2.4', version: '>= 2.48.0') |
| 13 | +diff --git a/src/ephy-shell.c b/src/ephy-shell.c |
| 14 | +index 650531da86..b9d1355e86 100644 |
| 15 | +--- a/src/ephy-shell.c |
| 16 | ++++ b/src/ephy-shell.c |
| 17 | +@@ -50,6 +50,7 @@ |
| 18 | + |
| 19 | + #include <glib/gi18n.h> |
| 20 | + #include <gtk/gtk.h> |
| 21 | ++#include <granite.h> |
| 22 | + #include <handy.h> |
| 23 | + |
| 24 | + struct _EphyShell { |
| 25 | +@@ -483,6 +484,20 @@ run_in_background_set_mapping (const GValue *value, |
| 26 | + return g_variant_new_boolean (g_variant_get_boolean (var)); |
| 27 | + } |
| 28 | + |
| 29 | ++static void |
| 30 | ++ephy_shell_set_prefers_color_scheme (EphyShell *shell) |
| 31 | ++{ |
| 32 | ++ GtkSettings* gtk_settings = gtk_settings_get_default (); |
| 33 | ++ GraniteSettings* granite_settings = granite_settings_get_default (); |
| 34 | ++ |
| 35 | ++ g_object_set ( |
| 36 | ++ gtk_settings, |
| 37 | ++ "gtk-application-prefer-dark-theme", |
| 38 | ++ granite_settings_get_prefers_color_scheme (granite_settings) == GRANITE_SETTINGS_COLOR_SCHEME_DARK, |
| 39 | ++ NULL |
| 40 | ++ ); |
| 41 | ++} |
| 42 | ++ |
| 43 | + static void |
| 44 | + ephy_shell_startup (GApplication *application) |
| 45 | + { |
| 46 | +@@ -490,11 +505,18 @@ ephy_shell_startup (GApplication *application) |
| 47 | + EphyShell *shell = EPHY_SHELL (application); |
| 48 | + EphyEmbedShellMode mode; |
| 49 | + GAction *action; |
| 50 | ++ GraniteSettings* granite_settings = granite_settings_get_default (); |
| 51 | + |
| 52 | + G_APPLICATION_CLASS (ephy_shell_parent_class)->startup (application); |
| 53 | + |
| 54 | + hdy_init (); |
| 55 | + |
| 56 | ++ ephy_shell_set_prefers_color_scheme (shell); |
| 57 | ++ |
| 58 | ++ g_signal_connect (granite_settings, "notify::prefers-color-scheme", |
| 59 | ++ G_CALLBACK (ephy_shell_set_prefers_color_scheme), shell |
| 60 | ++ ); |
| 61 | ++ |
| 62 | + /* If we are under Pantheon set the icon-theme and cursor-theme accordingly. */ |
| 63 | + if (is_desktop_pantheon ()) { |
| 64 | + GtkSettings *settings = gtk_settings_get_default (); |
| 65 | +diff --git a/src/meson.build b/src/meson.build |
| 66 | +index 5bf3eb92ec..d17b1b6d93 100644 |
| 67 | +--- a/src/meson.build |
| 68 | ++++ b/src/meson.build |
| 69 | +@@ -74,6 +74,7 @@ libephymain_deps = [ |
| 70 | + gdk_dep, |
| 71 | + gvdb_dep, |
| 72 | + libarchive_dep, |
| 73 | ++ libgranite_dep, |
| 74 | + libhandy_dep |
| 75 | + ] |
| 76 | + |
0 commit comments