[baobab] Add custom CSS



commit b32bd34132871d5389307ba14f26ed54308a146c
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Sat Jul 5 15:17:38 2014 +0200

    Add custom CSS
    
    Import custom CSS from gnome-themes-standard repository.

 src/Makefile.am             |    1 +
 src/baobab-application.vala |   10 +++++
 src/baobab.css              |   82 +++++++++++++++++++++++++++++++++++++++++++
 src/baobab.gresource.xml    |    1 +
 4 files changed, 94 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 08bbe25..4c8130a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,6 +61,7 @@ MAINTAINERCLEANFILES =        \
 
 EXTRA_DIST = \
        baobab.gresource.xml    \
+       baobab.css              \
        baobab-location-row.ui  \
        baobab-main-window.ui   \
        baobab-menu.ui          \
diff --git a/src/baobab-application.vala b/src/baobab-application.vala
index 7a15338..0cca507 100644
--- a/src/baobab-application.vala
+++ b/src/baobab-application.vala
@@ -75,6 +75,16 @@ namespace Baobab {
 
             baobab = this;
 
+            // Load custom CSS
+            var css_provider = new Gtk.CssProvider ();
+            var css_file = File.new_for_uri ("resource:///org/gnome/baobab/ui/baobab.css");
+            try {
+              css_provider.load_from_file (css_file);
+            } catch (Error e) {
+                warning ("loading css: %s", e.message);
+            }
+            Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), css_provider, 
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+
             // Settings
             ui_settings = new Settings ("org.gnome.baobab.ui");
             prefs_settings = new Settings ("org.gnome.baobab.preferences");
diff --git a/src/baobab.css b/src/baobab.css
new file mode 100644
index 0000000..df91637
--- /dev/null
+++ b/src/baobab.css
@@ -0,0 +1,82 @@
+.cell.baobab-level-cell,
+.cell.baobab-level-cell:hover,
+.cell.baobab-level-cell:selected,
+.cell.baobab-level-cell:selected:hover {
+    border-color: darker(@borders);
+    border-width: 1px;
+    border-radius: 3px;
+    border-style: solid;
+    background-color: white;
+}
+
+.cell.baobab-level-cell.fill-block,
+.cell.baobab-level-cell.fill-block:selected,
+.cell.baobab-level-cell.fill-block:selected:hover {
+    background-color: #edd400;
+}
+
+.cell.baobab-level-cell.fill-block.level-low,
+.cell.baobab-level-cell.fill-block.level-low:hover {
+    background-color: #73d216;
+}
+
+.cell.baobab-level-cell.fill-block.level-high,
+.cell.baobab-level-cell.fill-block.level-high:hover {
+    background-color: #cc0000;
+}
+
+.cell.baobab-level-cell.fill-block:backdrop,
+.cell.baobab-level-cell.fill-block:hover:backdrop,
+.cell.baobab-level-cell.fill-block.level-low:backdrop,
+.cell.baobab-level-cell.fill-block.level-high:backdrop {
+    background-color: @theme_unfocused_text_color;
+}
+
+.cell.baobab-cell-error {
+    color: @error_color;
+}
+
+.cell.baobab-cell-warning {
+    color: @warning_color;
+}
+
+.cell.baobab-cell-warning:selected,
+.cell.baobab-cell-error:selected {
+    color: @theme_selected_fg_color;
+}
+
+.cell.baobab-cell-warning:backdrop,
+.cell.baobab-cell-error:backdrop,
+.cell.baobab-cell-warning:selected:backdrop,
+.cell.baobab-cell-error:selected:backdrop {
+    color: @theme_unfocused_text_color;
+}
+
+BaobabWindow.background GtkStack > GtkGrid > GtkScrolledWindow.frame {
+    border-radius: 0;
+    border-width: 0 1px 0 0;
+}
+
+BaobabWindow GtkInfoBar.warning,
+BaobabWindow GtkInfoBar.error {
+    border-bottom-width: 1px;
+    border-bottom-style: solid;
+    border-bottom-color: @borders;
+}
+
+BaobabRingschart {
+    background-color: @theme_bg_color;
+    padding: 13px 13px 13px 13px;
+}
+
+BaobabRingschart.subfolder-tip {
+    border-radius: 3px;
+    border-style: none;
+    padding: 3px 3px 3px 3px;
+
+    background-color: alpha(@theme_tooltip_bg_color, 0.90);
+    color: @theme_tooltip_fg_color;
+
+    text-shadow: 1px 1px black;
+}
+
diff --git a/src/baobab.gresource.xml b/src/baobab.gresource.xml
index f2fcb23..cfbe56d 100644
--- a/src/baobab.gresource.xml
+++ b/src/baobab.gresource.xml
@@ -4,5 +4,6 @@
     <file preprocess="xml-stripblanks">baobab-location-row.ui</file>
     <file preprocess="xml-stripblanks">baobab-main-window.ui</file>
     <file preprocess="xml-stripblanks">baobab-menu.ui</file>
+    <file compressed="true">baobab.css</file>
   </gresource>
 </gresources>


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