From d46b6e8d7a6e8df18d2c8605979e86b10f7920d5 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 11 Aug 2019 11:26:31 +0200 Subject: 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 --- src/gs-lock-plug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.1