[gnome-builder/editor-layout] incremental prototyping



commit ccc3781b1e20db082c804bbd2943bb5115ac4bc4
Author: Christian Hergert <christian hergert me>
Date:   Tue Nov 25 21:38:30 2014 -0800

    incremental prototyping

 data/icons/Makefile.am                             |    3 +-
 data/icons/hicolor/16x16/apps/builder-drag-tab.png |  Bin 213 -> 0 bytes
 .../hicolor/16x16/apps/builder-move-tab-left.png   |  Bin 0 -> 221 bytes
 .../hicolor/16x16/apps/builder-move-tab-right.png  |  Bin 0 -> 221 bytes
 src/resources/ui/gb-editor-tab.ui                  |    2 +
 src/resources/ui/gb-tab-stack.ui                   |   34 ++++++++++++++-----
 src/tabs/gb-tab-stack.c                            |   10 +++--
 7 files changed, 35 insertions(+), 14 deletions(-)
---
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index ae6c1a9..0798c88 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -5,7 +5,8 @@ nobase_icon_DATA = \
        hicolor/256x256/apps/builder.png \
        hicolor/512x512/apps/builder.png \
        hicolor/16x16/apps/builder.png \
-       hicolor/16x16/apps/builder-drag-tab.png \
+       hicolor/16x16/apps/builder-move-tab-left.png \
+       hicolor/16x16/apps/builder-move-tab-right.png \
        hicolor/16x16/apps/builder-split-tab.png \
        hicolor/32x32/apps/builder.png \
        hicolor/48x48/apps/builder.png \
diff --git a/data/icons/hicolor/16x16/apps/builder-move-tab-left.png 
b/data/icons/hicolor/16x16/apps/builder-move-tab-left.png
new file mode 100644
index 0000000..1518747
Binary files /dev/null and b/data/icons/hicolor/16x16/apps/builder-move-tab-left.png differ
diff --git a/data/icons/hicolor/16x16/apps/builder-move-tab-right.png 
b/data/icons/hicolor/16x16/apps/builder-move-tab-right.png
new file mode 100644
index 0000000..29e0a11
Binary files /dev/null and b/data/icons/hicolor/16x16/apps/builder-move-tab-right.png differ
diff --git a/src/resources/ui/gb-editor-tab.ui b/src/resources/ui/gb-editor-tab.ui
index b1113d1..a62f876 100644
--- a/src/resources/ui/gb-editor-tab.ui
+++ b/src/resources/ui/gb-editor-tab.ui
@@ -23,7 +23,9 @@
         <child>
           <object class="GtkButton" id="split_button">
             <property name="visible">True</property>
+            <property name="tooltip_text">Split tab vertically</property>
             <style>
+              <class name="image-button"/>
               <class name="tab-control-last"/>
             </style>
             <child>
diff --git a/src/resources/ui/gb-tab-stack.ui b/src/resources/ui/gb-tab-stack.ui
index ff22e3a..631e011 100644
--- a/src/resources/ui/gb-tab-stack.ui
+++ b/src/resources/ui/gb-tab-stack.ui
@@ -11,39 +11,55 @@
           <class name="linked"/>
         </style>
         <child>
-          <object class="GtkComboBox" id="combo">
+          <object class="GtkButton" id="move_left">
             <property name="visible">true</property>
-            <property name="hexpand">true</property>
-            <property name="model">store</property>
+            <property name="action_name">tabs.move-left</property>
+            <property name="tooltip_text">Move tab to the left</property>
             <style>
+              <class name="image-button"/>
               <class name="tab-header-first"/>
             </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkStack" id="controls">
-            <property name="visible">true</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">true</property>
+                <property name="icon_name">builder-move-tab-left</property>
+              </object>
+            </child>
           </object>
         </child>
         <child>
           <object class="GtkButton" id="move_right">
             <property name="visible">true</property>
             <property name="action_name">tabs.move-right</property>
+            <property name="tooltip_text">Move tab to the right</property>
             <style>
               <class name="image-button"/>
             </style>
             <child>
               <object class="GtkImage">
                 <property name="visible">true</property>
-                <property name="icon_name">builder-drag-tab</property>
+                <property name="icon_name">builder-move-tab-right</property>
               </object>
             </child>
           </object>
         </child>
         <child>
+          <object class="GtkComboBox" id="combo">
+            <property name="visible">true</property>
+            <property name="hexpand">true</property>
+            <property name="model">store</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkStack" id="controls">
+            <property name="visible">true</property>
+          </object>
+        </child>
+        <child>
           <object class="GtkButton" id="close">
             <property name="visible">true</property>
             <property name="sensitive">false</property>
+            <property name="tooltip_text">Close tab</property>
             <style>
               <class name="image-button"/>
               <class name="tab-header-last"/>
diff --git a/src/tabs/gb-tab-stack.c b/src/tabs/gb-tab-stack.c
index dbeaa73..8feab91 100644
--- a/src/tabs/gb-tab-stack.c
+++ b/src/tabs/gb-tab-stack.c
@@ -161,14 +161,16 @@ gb_tab_stack_remove_tab (GbTabStack *stack,
                             gb_tab_get_controls (tab));
       gtk_container_remove (GTK_CONTAINER (stack->priv->stack),
                             GTK_WIDGET (tab));
+
       if (!gtk_list_store_remove (stack->priv->store, &iter))
         {
           guint count;
 
-          count = gtk_tree_model_iter_n_children (model, NULL);
-
-          if (gtk_tree_model_iter_nth_child (model, &iter, NULL, count-1))
-            gb_tab_stack_focus_iter (stack, &iter);
+          if ((count = gtk_tree_model_iter_n_children (model, NULL)))
+            {
+              if (gtk_tree_model_iter_nth_child (model, &iter, NULL, count-1))
+                gb_tab_stack_focus_iter (stack, &iter);
+            }
         }
       else
         gb_tab_stack_focus_iter (stack, &iter);


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