[gnome-builder] style: fix height of tab/pane header



commit 0fa4e76b7cc837af44962b67ba38ef87bbebd473
Author: Christian Hergert <chergert redhat com>
Date:   Sat Dec 19 02:05:41 2015 -0800

    style: fix height of tab/pane header
    
    This is sort of hacky, to use box-shadow for the bottom border without
    incurring the extra height. But I'm not very good at this sort of stuff.
    
    Would love for someone to come own our styling in Builder.

 data/theme/Adwaita-dark.css       |    6 ++++++
 data/theme/Adwaita.css            |   11 +++++++++--
 data/ui/ide-editor-perspective.ui |    4 ++--
 data/ui/ide-layout-pane.ui        |    2 +-
 libide/ide-layout-pane.c          |    2 ++
 5 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/data/theme/Adwaita-dark.css b/data/theme/Adwaita-dark.css
index 3b1ca52..d6cafaa 100644
--- a/data/theme/Adwaita-dark.css
+++ b/data/theme/Adwaita-dark.css
@@ -159,6 +159,7 @@ layouttab button {
 layouttab label {
   color: #eeeeec;
   text-shadow: 0 1px #101010;
+  margin-bottom: -2px;
 }
 
 layouttab label:backdrop {
@@ -250,6 +251,11 @@ layoutpane > box > box:first-child > stackswitcher > button {
   min-width: 0;
 }
 
+layoutpane > box > box:first-child > stackswitcher > button > label {
+  margin-top: 2px;
+  margin-bottom: -2px;
+}
+
 layoutpane > box > box:first-child > stackswitcher > button:checked {
   border-bottom: 3px solid @theme_selected_bg_color;
   color: #fafafa;
diff --git a/data/theme/Adwaita.css b/data/theme/Adwaita.css
index 32b94a8..cefe799 100644
--- a/data/theme/Adwaita.css
+++ b/data/theme/Adwaita.css
@@ -145,6 +145,7 @@ layouttab button:insensitive {
 layouttab label {
   color: #2e3436;
   text-shadow: 0 1px #eeeeec;
+  margin-bottom: -2px;
 }
 
 layouttab label:hover {
@@ -223,9 +224,10 @@ layoutpane > box > box:first-child {
   background-color: #d6d6d6;
   border-style: none;
   border-radius: 0px;
-  border-bottom: 1px solid #919191;
+  border-width: 0px;
   color: #2e3436;
-  box-shadow: 0px 5px 5px -10px #2e3436 inset;
+  box-shadow: 0px 5px 5px -10px #2e3436 inset,
+              0px -1px 0px @borders inset;
 }
 
 layoutpane > box > box:first-child > stackswitcher > button {
@@ -242,6 +244,11 @@ layoutpane > box > box:first-child > stackswitcher > button {
   min-width: 0;
 }
 
+layoutpane > box > box:first-child > stackswitcher > button > label {
+  margin-top: 2px;
+  margin-bottom: -2px;
+}
+
 layoutpane > box > box:first-child > stackswitcher > button:checked {
   border-bottom: 3px solid @theme_selected_bg_color;
   color: #2e3436;
diff --git a/data/ui/ide-editor-perspective.ui b/data/ui/ide-editor-perspective.ui
index 2f1301b..188ed6a 100644
--- a/data/ui/ide-editor-perspective.ui
+++ b/data/ui/ide-editor-perspective.ui
@@ -4,8 +4,8 @@
   <template class="IdeEditorPerspective" parent="IdeLayout">
     <child internal-child="content_pane">
       <object class="IdeLayoutPane">
-        <child internal-child="stack_switcher">
-          <object class="GtkStackSwitcher">
+        <child internal-child="header">
+          <object class="GtkBox">
             <property name="visible">false</property>
           </object>
         </child>
diff --git a/data/ui/ide-layout-pane.ui b/data/ui/ide-layout-pane.ui
index 710cc5a..7b7f3ea 100644
--- a/data/ui/ide-layout-pane.ui
+++ b/data/ui/ide-layout-pane.ui
@@ -7,7 +7,7 @@
         <property name="orientation">vertical</property>
         <property name="visible">true</property>
         <child>
-          <object class="GtkBox">
+          <object class="GtkBox" id="header">
             <property name="visible">true</property>
             <property name="vexpand">false</property>
             <child type="center">
diff --git a/libide/ide-layout-pane.c b/libide/ide-layout-pane.c
index 403df61..969f850 100644
--- a/libide/ide-layout-pane.c
+++ b/libide/ide-layout-pane.c
@@ -29,6 +29,7 @@ struct _IdeLayoutPane
   GtkBin            parent_instance;
 
   GtkBox           *box;
+  GtkBox           *header;
   GtkStackSwitcher *stack_switcher;
   GtkStack         *stack;
 
@@ -317,6 +318,7 @@ ide_layout_pane_class_init (IdeLayoutPaneClass *klass)
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/builder/ui/ide-layout-pane.ui");
   gtk_widget_class_bind_template_child (widget_class, IdeLayoutPane, box);
   gtk_widget_class_bind_template_child_internal (widget_class, IdeLayoutPane, stack);
+  gtk_widget_class_bind_template_child_internal (widget_class, IdeLayoutPane, header);
   gtk_widget_class_bind_template_child_internal (widget_class, IdeLayoutPane, stack_switcher);
 }
 


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