[gnome-text-editor] css: rely on AdwApplication to load custom CSS



commit 4682d4da1ac07061fceb0f809671ec34b08dd9f6
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jan 23 15:36:42 2022 -0800

    css: rely on AdwApplication to load custom CSS

 src/editor-application.c               | 8 --------
 src/org.gnome.TextEditor.gresource.xml | 4 ++--
 src/{TextEditor.css => style.css}      | 0
 3 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/src/editor-application.c b/src/editor-application.c
index bf11f63..4b8bbbd 100644
--- a/src/editor-application.c
+++ b/src/editor-application.c
@@ -284,7 +284,6 @@ editor_application_startup (GApplication *application)
 
   EditorApplication *self = (EditorApplication *)application;
   GtkSourceStyleSchemeManager *schemes;
-  g_autoptr(GtkCssProvider) css_provider = NULL;
   g_autoptr(GVariant) all = NULL;
   AdwStyleManager *style_manager;
   GdkDisplay *display;
@@ -351,13 +350,6 @@ editor_application_startup (GApplication *application)
                                 style_variant_to_color_scheme,
                                 NULL, NULL, NULL);
 
-  /* Setup CSS overrides */
-  css_provider = gtk_css_provider_new ();
-  gtk_css_provider_load_from_resource (css_provider, "/org/gnome/TextEditor/css/TextEditor.css");
-  gtk_style_context_add_provider_for_display (gdk_display_get_default (),
-                                              GTK_STYLE_PROVIDER (css_provider),
-                                              GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
   /* Setup any recoloring that needs to be done */
   update_css (self);
 
diff --git a/src/org.gnome.TextEditor.gresource.xml b/src/org.gnome.TextEditor.gresource.xml
index 48bdeb6..d2c14e7 100644
--- a/src/org.gnome.TextEditor.gresource.xml
+++ b/src/org.gnome.TextEditor.gresource.xml
@@ -17,8 +17,8 @@
     <file preprocess="xml-stripblanks">editor-window.ui</file>
     <file preprocess="xml-stripblanks">help-overlay.ui</file>
   </gresource>
-  <gresource prefix="/org/gnome/TextEditor/css">
-    <file>TextEditor.css</file>
+  <gresource prefix="/org/gnome/TextEditor">
+    <file>style.css</file>
   </gresource>
   <gresource prefix="/plugins/modelines">
     <file alias="language-mappings">modelines/language-mappings</file>
diff --git a/src/TextEditor.css b/src/style.css
similarity index 100%
rename from src/TextEditor.css
rename to src/style.css


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