[gnome-calculator] Style history window border



commit 5a64c9b0835908c58a28cb8a8b7b520163efbbb7
Author: Trinh Anh Ngoc <atw1990 gmail com>
Date:   Mon Dec 1 10:55:01 2014 +0700

    Style history window border

 data/Makefile.am                    |    1 +
 data/calculator.css                 |    3 +++
 data/gnome-calculator.gresource.xml |    1 +
 src/math-window.vala                |   14 ++++++++++++++
 4 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 62bb604..dd09811 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -19,6 +19,7 @@ EXTRA_DIST = \
        buttons-financial.ui \
        buttons-programming.ui \
        menu.ui \
+       calculator.css \
        gnome-calculator.gresource.xml \
        $(appdata_in_files) \
        $(desktop_in_files) \
diff --git a/data/calculator.css b/data/calculator.css
new file mode 100644
index 0000000..6b20cb2
--- /dev/null
+++ b/data/calculator.css
@@ -0,0 +1,3 @@
+MathDisplay GtkScrolledWindow {
+       border-width: 0 0 1px 0;
+}
diff --git a/data/gnome-calculator.gresource.xml b/data/gnome-calculator.gresource.xml
index c625834..3df5c51 100644
--- a/data/gnome-calculator.gresource.xml
+++ b/data/gnome-calculator.gresource.xml
@@ -6,5 +6,6 @@
     <file preprocess="xml-stripblanks">buttons-financial.ui</file>
     <file preprocess="xml-stripblanks">buttons-programming.ui</file>
     <file preprocess="xml-stripblanks">menu.ui</file>
+    <file>calculator.css</file>
   </gresource>
 </gresources>
diff --git a/src/math-window.vala b/src/math-window.vala
index eb4743c..7dd94a5 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -129,6 +129,20 @@ public class MathWindow : Gtk.ApplicationWindow
         buttons.show ();
         buttons.notify["mode"].connect (mode_changed_cb);
         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);
+        }
     }
 
     private void mode_changed_cb ()


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