[baobab/wip/gtk4: 4/5] application: load CSS directly from resource



commit 0eedf0d3a5b98f44600432eed63d0360de6e4bf2
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Mon Oct 30 11:25:35 2017 +0100

    application: load CSS directly from resource

 src/baobab-application.vala |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/baobab-application.vala b/src/baobab-application.vala
index 9641405..e5c97a2 100644
--- a/src/baobab-application.vala
+++ b/src/baobab-application.vala
@@ -74,8 +74,7 @@ namespace Baobab {
 
             // Load custom CSS
             var css_provider = new Gtk.CssProvider ();
-            var css_file = File.new_for_uri ("resource:///org/gnome/baobab/baobab.css");
-            css_provider.load_from_file (css_file);
+            css_provider.load_from_resource ("/org/gnome/baobab/baobab.css");
             Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), css_provider, 
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
 
             set_accels_for_action ("win.scan-folder", { "<Primary>o" });


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