[gnome-boxes] Some theme improvements



commit b3c6a9f6ac2a4b1a21292f0a66304bebfaf0b244
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Wed Oct 19 10:50:41 2011 +0200

    Some theme improvements

 data/gtk-style.css |   21 +++++++++++++++++----
 src/sidebar.vala   |    2 +-
 src/util.vala      |    6 ++++++
 src/wizard.vala    |   10 +++++-----
 4 files changed, 29 insertions(+), 10 deletions(-)
---
diff --git a/data/gtk-style.css b/data/gtk-style.css
index 1e9b8e1..b948eca 100644
--- a/data/gtk-style.css
+++ b/data/gtk-style.css
@@ -1,5 +1,6 @@
- define-color boxes_bg_color darker (@theme_bg_color);
- define-color boxes_continue_color #5f8dd3;
+ define-color boxes_bg_color shade (@theme_bg_color, 0.5);
+ define-color boxes_sidebar_bg_color mix (@theme_bg_color, @boxes_bg_color, 0.5);
+ define-color boxes_selected_color #5f8dd3;
 
 #TopbarLabel {
     font-size: 14;
@@ -14,6 +15,10 @@
     background-color: @boxes_bg_color;
 }
 
+.boxes-sidebar-bg {
+    background-color: @boxes_sidebar_bg_color;
+}
+
 .boxes-step-label {
     color: gray;
     font-size: 11;
@@ -25,9 +30,17 @@
     font-weight: bold;
 }
 
+.boxes-source-nb {
+    border-radius: 15;
+}
+
+.boxes-selected {
+    background-color: @boxes_selected_color;
+}
+
 .boxes-continue {
     background-image: -gtk-gradient (linear,
                                      left top, left bottom,
-                                     from (@boxes_continue_color),
-                                     to (darker (@boxes_continue_color)));
+                                     from (@boxes_selected_color),
+                                     to (darker (@boxes_selected_color)));
 }
diff --git a/src/sidebar.vala b/src/sidebar.vala
index 71e46c9..dd83716 100644
--- a/src/sidebar.vala
+++ b/src/sidebar.vala
@@ -69,6 +69,7 @@ private class Boxes.Sidebar: Boxes.UI {
 
     private void setup_sidebar () {
         notebook = new Gtk.Notebook ();
+        notebook.get_style_context ().add_class ("boxes-sidebar-bg");
         notebook.set_size_request ((int) width, 100);
 
         /* SidebarPage.COLLECTION */
@@ -76,7 +77,6 @@ private class Boxes.Sidebar: Boxes.UI {
         notebook.append_page (vbox, null);
 
         tree_view = new Gtk.TreeView ();
-        tree_view.set_name ("MyTreeview");
         var selection = tree_view.get_selection ();
         selection.set_select_function (selection_func);
         tree_view_activate_on_single_click (tree_view, true);
diff --git a/src/util.vala b/src/util.vala
index ff5a25b..7d89d92 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -61,6 +61,12 @@ namespace Boxes {
         return color;
     }
 
+    private Gdk.RGBA get_rgba (string desc) {
+        Gdk.RGBA rgba = { 0.0, 0.0, 0.0, 0.0 };
+        rgba.parse (desc);
+        return rgba;
+    }
+
     private void tree_view_activate_on_single_click (Gtk.TreeView tree_view, bool should_activate) {
         var id = tree_view.get_data<ulong> ("boxes-tree-view-activate");
 
diff --git a/src/wizard.vala b/src/wizard.vala
index ebfa565..e0f7f5f 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -35,11 +35,12 @@ private class Boxes.Source: GLib.Object {
 
     public Source () {
         notebook = new Gtk.Notebook ();
+        notebook.get_style_context ().add_class ("boxes-source-nb");
         notebook.show_tabs = false;
 
         /* main page */
         var vbox = new Gtk.VBox (false, 10);
-        vbox.margin_top = vbox.margin_bottom = 20;
+        vbox.margin_top = vbox.margin_bottom = 15;
         notebook.append_page (vbox, null);
 
         var hbox = add_entry (vbox, () => { page = SourcePage.URL; });
@@ -62,7 +63,7 @@ private class Boxes.Source: GLib.Object {
 
         /* URL page */
         vbox = new Gtk.VBox (false, 10);
-        vbox.margin_top = vbox.margin_bottom = 20;
+        vbox.margin_top = vbox.margin_bottom = 15;
         notebook.append_page (vbox, null);
 
         hbox = add_entry (vbox, () => { page = SourcePage.MAIN; });
@@ -94,6 +95,7 @@ private class Boxes.Source: GLib.Object {
 
     private Gtk.HBox add_entry (Gtk.VBox vbox, ClickedFunc? clicked = null) {
         var ebox = new Gtk.EventBox ();
+        ebox.visible_window = false;
         var hbox = new Gtk.HBox (false, 20);
         ebox.add (hbox);
         vbox.pack_start (ebox, false, false);
@@ -175,9 +177,7 @@ private class Boxes.Wizard: Boxes.UI {
             }
 
             /* highlight in white current page label */
-            Gdk.Color white;
-            Gdk.Color.parse ("white", out white);
-            steps.get (page).modify_fg (Gtk.StateType.NORMAL, white);
+            steps.get (page).modify_fg (Gtk.StateType.NORMAL, get_color ("white"));
 
             back_button.set_sensitive (page != WizardPage.INTRODUCTION);
             next_button.set_label (page != WizardPage.REVIEW ? _("Continue") : _("Create"));



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