[gnome-control-center/590-region-and-language-input-sources-list-doesn-t-look-draggable: 25/26] shell: Add global CSS stylesheet



commit 4f099e33c5fd3afa9ad37c1e5b62abb9ba645ec5
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Jun 21 15:17:47 2019 +0200

    shell: Add global CSS stylesheet

 shell/cc-application.c                   | 8 ++++++++
 shell/gnome-control-center.gresource.xml | 1 +
 shell/style.css                          | 0
 3 files changed, 9 insertions(+)
---
diff --git a/shell/cc-application.c b/shell/cc-application.c
index 67beb383c..aea0e9b72 100644
--- a/shell/cc-application.c
+++ b/shell/cc-application.c
@@ -276,9 +276,17 @@ cc_application_class_init (CcApplicationClass *klass)
 static void
 cc_application_init (CcApplication *self)
 {
+  g_autoptr(GtkCssProvider) provider = NULL;
+
   cc_object_storage_initialize ();
 
   g_application_add_main_option_entries (G_APPLICATION (self), all_options);
+
+  provider = gtk_css_provider_new ();
+  gtk_css_provider_load_from_resource (provider, "/org/gnome/ControlCenter/gtk/style.css");
+  gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+                                             GTK_STYLE_PROVIDER (provider),
+                                             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 }
 
 GtkApplication *
diff --git a/shell/gnome-control-center.gresource.xml b/shell/gnome-control-center.gresource.xml
index 567dc783b..9be077ec9 100644
--- a/shell/gnome-control-center.gresource.xml
+++ b/shell/gnome-control-center.gresource.xml
@@ -4,5 +4,6 @@
     <file preprocess="xml-stripblanks">cc-panel-list.ui</file>
     <file preprocess="xml-stripblanks">cc-window.ui</file>
     <file preprocess="xml-stripblanks">help-overlay.ui</file>
+    <file>style.css</file>
   </gresource>
 </gresources>
diff --git a/shell/style.css b/shell/style.css
new file mode 100644
index 000000000..e69de29bb


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