[meld] Move CSS into resources



commit 8ea9d32561ef6b3ee0c5acc2c5f59347d5232dbe
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Mon Oct 14 06:32:19 2019 +1000

    Move CSS into resources

 bin/meld                          | 8 ++------
 {data => meld/resources}/meld.css | 0
 meld/resources/meld.gresource.xml | 1 +
 3 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index 7a6ab4e8..28607a84 100755
--- a/bin/meld
+++ b/bin/meld
@@ -24,6 +24,7 @@ import subprocess
 import sys
 from multiprocessing import freeze_support
 
+
 # On Windows, pythonw.exe (which doesn't display a console window) supplies
 # dummy stdout and stderr streams that silently throw away any output. However,
 # these streams seem to have issues with flush() so we just redirect stdout and
@@ -238,7 +239,6 @@ def check_requirements():
 
 def setup_resources():
     from gi.repository import Gio
-    from gi.repository import GLib
     from gi.repository import Gtk
     from gi.repository import Gdk
     from gi.repository import GtkSource
@@ -268,12 +268,8 @@ def setup_resources():
     icon_dir = os.path.join(meld.conf.DATADIR, "icons")
     Gtk.IconTheme.get_default().append_search_path(icon_dir)
 
-    css_file = os.path.join(meld.conf.DATADIR, "meld.css")
     provider = Gtk.CssProvider()
-    try:
-        provider.load_from_path(css_file)
-    except GLib.GError as err:
-        print(_("Couldn’t load Meld-specific CSS (%s)\n%s") % (css_file, err))
+    provider.load_from_resource('/org/gnome/meld/meld.css')
     Gtk.StyleContext.add_provider_for_screen(
         Gdk.Screen.get_default(), provider,
         Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
diff --git a/data/meld.css b/meld/resources/meld.css
similarity index 100%
rename from data/meld.css
rename to meld/resources/meld.css
diff --git a/meld/resources/meld.gresource.xml b/meld/resources/meld.gresource.xml
index be2d5c53..da158901 100644
--- a/meld/resources/meld.gresource.xml
+++ b/meld/resources/meld.gresource.xml
@@ -7,6 +7,7 @@
     <file>icons/16x16/actions/meld-change-apply-right.png</file>
     <file>icons/16x16/actions/meld-change-copy.png</file>
     <file>icons/16x16/actions/meld-change-delete.png</file>
+    <file>meld.css</file>
     <file>ui/about-dialog.ui</file>
     <file>ui/appwindow.ui</file>
     <file>ui/column-list.ui</file>


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