[gitg/wip/sidebar] Make switcher buttons visually grouped with panels



commit 9f7dc800602a6e49d394a94f842189434a41f2bc
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Tue Jul 2 21:15:23 2013 +0200

    Make switcher buttons visually grouped with panels

 gitg/history/gitg-history-paned.vala    |   26 ++++++++++++++++++++++++++
 gitg/resources/ui/gitg-history-paned.ui |    4 +++-
 gitg/resources/ui/style.css             |    5 +++++
 3 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/gitg/history/gitg-history-paned.vala b/gitg/history/gitg-history-paned.vala
index 3598396..1dbbcc1 100644
--- a/gitg/history/gitg-history-paned.vala
+++ b/gitg/history/gitg-history-paned.vala
@@ -98,6 +98,32 @@ class Paned : Gtk.Paned
        {
                get { return d_stack_panel; }
        }
+
+       protected override bool draw(Cairo.Context context)
+       {
+               var ret = base.draw(context);
+
+               var c = get_style_context();
+               c.save();
+
+               c.add_region("panel-switcher", 0);
+
+               Gtk.Allocation alloc;
+               d_stack_switcher_panels.get_allocation(out alloc);
+
+               var y = alloc.y - d_box_sidebar.spacing;
+               var hw = get_handle_window().get_width();
+               var w = position + hw;
+               var h = alloc.height + d_box_sidebar.spacing + d_stack_switcher_panels.margin_bottom;
+
+               c.render_frame(context, 0, y, w, h);
+
+               c.render_background(context, position, y, hw, h);
+
+               c.restore();
+
+               return ret;
+       }
 }
 
 }
diff --git a/gitg/resources/ui/gitg-history-paned.ui b/gitg/resources/ui/gitg-history-paned.ui
index 920f47e..603acbc 100644
--- a/gitg/resources/ui/gitg-history-paned.ui
+++ b/gitg/resources/ui/gitg-history-paned.ui
@@ -19,6 +19,7 @@
         <property name="hexpand">True</property>
         <property name="vexpand">True</property>
         <property name="orientation">vertical</property>
+        <property name="spacing">6</property>
         <child>
           <object class="GtkScrolledWindow" id="scrolled_window_navigation">
             <property name="visible">True</property>
@@ -48,7 +49,7 @@
           <object class="GtkStackSwitcher" id="d_stack_switcher_panels">
             <property name="visible">True</property>
             <property name="halign">center</property>
-            <property name="margin">6</property>
+            <property name="margin-bottom">6</property>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -143,6 +144,7 @@
           <object class="GtkStack" id="d_stack_panel">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="border-width">6</property>
             <child>
               <placeholder/>
             </child>
diff --git a/gitg/resources/ui/style.css b/gitg/resources/ui/style.css
index 847b708..2a3dd93 100644
--- a/gitg/resources/ui/style.css
+++ b/gitg/resources/ui/style.css
@@ -86,6 +86,11 @@ GtkLabel.grid_title {
        background-color: @sidebar_bg_unfocused;
 }
 
+GitgHistoryPaned panel-switcher {
+       border-top: 1px solid @borders;
+       background-color: @theme_bg_color;
+}
+
 .progress-bin {
        background-color: shade (@theme_bg_color, 0.9);
 }


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