summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-08-11 11:26:31 +0200
committerraveit65 <[email protected]>2019-08-19 22:04:59 +0200
commitd46b6e8d7a6e8df18d2c8605979e86b10f7920d5 (patch)
tree4fab6fbda99bcb4c40d5eb3d0ecaa9d5cf3498a5 /src
parent46c7fbf1cb220533b1f2432a63373d04a23a3160 (diff)
downloadmate-screensaver-d46b6e8d7a6e8df18d2c8605979e86b10f7920d5.tar.bz2
mate-screensaver-d46b6e8d7a6e8df18d2c8605979e86b10f7920d5.tar.xz
lock-dialog: add style_provider to current screen globally
gtk_style_context_add_provider_for_screen (gdk_screen_get_default(), GTK_STYLE_PROVIDER (style_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-style-context-add-provider-for-screen css data is located at /usr/share/mate-screensaver/lock-dialog-THEME.css, XDG_CONFIG_HOME/gtk-3.0/gtk.css, /usr/share/themes/... /usr/share/mate-screensaver/lock-dialog-THEME.css file has highest priority, if exists: $ gsettings get org.mate.screensaver lock-dialog-theme 'test' $ grep lock-dialog /usr/share/mate-screensaver/lock-dialog-test.css .lock-dialog.background { .lock-dialog frame { .lock-dialog notebook { .lock-dialog entry, .lock-dialog entry:focus { .lock-dialog button, .lock-dialog button:focus { .lock-dialog button:hover, .lock-dialog button:hover:active { ... Otherwise: /usr/share/themes folder if lock-dialog-theme is set to 'debault' $ gsettings get org.mate.screensaver lock-dialog-theme 'default' $ gsettings get org.mate.interface gtk-theme 'TraditionalOk' $ grep lock-dialog /usr/share/themes/TraditionalOk/gtk-3.0/*.css /usr/share/themes/TraditionalOk/gtk-3.0/mate-applications.css:.lock-dialog { /usr/share/themes/TraditionalOk/gtk-3.0/mate-applications.css:.lock-dialog notebook { Priority order: https://developer.gnome.org/gtk3/stable/GtkStyleProvider.html
Diffstat (limited to 'src')
-rw-r--r--src/gs-lock-plug.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index c3081c2..70d0859 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -2003,7 +2003,6 @@ load_theme (GSLockPlug *plug)
filename = g_strdup_printf ("lock-dialog-%s.css", theme);
g_free (theme);
-
css = g_build_filename (GTKBUILDERDIR, filename, NULL);
g_free (filename);
if (g_file_test (css, G_FILE_TEST_IS_REGULAR))
@@ -2011,8 +2010,14 @@ load_theme (GSLockPlug *plug)
static GtkCssProvider *style_provider = NULL;
if (style_provider == NULL)
+ {
style_provider = gtk_css_provider_new ();
+ gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
+ GTK_STYLE_PROVIDER (style_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+ }
+
gtk_css_provider_load_from_path (style_provider, css, NULL);
}
g_free (css);