[gnome-calculator] Use load_from_resource in the Gtk.CssProvider instead of opening the file manually



commit 6919f023aeabf6feb53c93263797d61e2c889dd5
Author: Alberto Ruiz <aruiz gnome org>
Date:   Sun Jan 17 03:47:14 2016 +0000

    Use load_from_resource in the Gtk.CssProvider instead of opening the file manually

 src/math-window.vala |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/src/math-window.vala b/src/math-window.vala
index 5b43bab..c5e5ba8 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -68,18 +68,8 @@ public class MathWindow : Gtk.ApplicationWindow
         mode_changed_cb ();
 
         var provider = new Gtk.CssProvider ();
-        var file = File.new_for_uri ("resource:///org/gnome/calculator/calculator.css");
-        try
-        {
-            if (provider.load_from_file (file))
-            {
-                Gtk.StyleContext.add_provider_for_screen (this.get_screen (), provider, 
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
-            }
-        }
-        catch (Error e)
-        {
-            warning ("Error while loading css: %s", e.message);
-        }
+        provider.load_from_resource ("/org/gnome/calculator/calculator.css");
+        Gtk.StyleContext.add_provider_for_screen (get_screen (), provider, 
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
     }
 
     private void mode_changed_cb ()


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