[gtk+/wip/csoriano/pathbar-prototype] debug



commit 7cd0f8005e6f839217f1b1466ad02d9487b94d22
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue Nov 10 16:57:47 2015 +0100

    debug

 gtk/gtkpathbar.c     |   16 ++++++++--------
 gtk/gtkpathbar.h     |    6 +++---
 gtk/ui/gtkpathbar.ui |   30 +-----------------------------
 3 files changed, 12 insertions(+), 40 deletions(-)
---
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 208bd7f..efae3d8 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -54,7 +54,7 @@ struct _GtkPathBarPrivate
   gboolean selecting_path;
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (GtkPathBar, gtk_path_bar, GTK_TYPE_STACK)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkPathBar, gtk_path_bar, GTK_TYPE_BOX)
 
 enum {
   POPULATE_POPUP,
@@ -107,8 +107,8 @@ get_path_bar_widgets (GtkPathBar *self,
   GtkPathBarPrivate *priv = gtk_path_bar_get_instance_private (GTK_PATH_BAR (self));
   GtkWidget *current_path_bar;
 
-  current_path_bar = gtk_stack_get_visible_child (GTK_STACK (self));
-  if (current_path_bar == NULL ||
+  //current_path_bar = gtk_stack_get_visible_child (GTK_STACK (self));
+  if (TRUE || current_path_bar == NULL ||
       (current_path_bar == priv->path_bar_1 && current) ||
       (current_path_bar == priv->path_bar_2 && !current))
     {
@@ -528,11 +528,11 @@ gtk_path_bar_class_init (GtkPathBarClass *klass)
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtkpathbar.ui");
 
   gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, path_bar_1);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, path_bar_2);
+  //gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, path_bar_2);
   gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, overflow_button_1);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, overflow_button_2);
+  //gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, overflow_button_2);
   gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, path_box_1);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, path_box_2);
+  //gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, path_box_2);
   gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, overflow_popover);
   gtk_widget_class_bind_template_child_private (widget_class, GtkPathBar, overflow_container);
 
@@ -577,7 +577,7 @@ gtk_path_bar_set_path (GtkPathBar  *self,
   get_path_bar_widgets (GTK_PATH_BAR (self), &path_bar, &overflow_button, &path_box, FALSE);
 
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->overflow_button_1), FALSE);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->overflow_button_2), FALSE);
+  //gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->overflow_button_2), FALSE);
 
   gtk_container_foreach (GTK_CONTAINER (path_box), (GtkCallback) gtk_widget_destroy, NULL);
 
@@ -613,7 +613,7 @@ gtk_path_bar_set_path (GtkPathBar  *self,
       priv->path = g_strdup (data->path->str);
     }
 
-  gtk_stack_set_visible_child (GTK_STACK (self), path_bar);
+  //gtk_stack_set_visible_child (GTK_STACK (self), path_bar);
   g_object_notify_by_pspec (G_OBJECT (self), path_bar_properties[PROP_PATH]);
 
   g_strfreev (splitted_path);
diff --git a/gtk/gtkpathbar.h b/gtk/gtkpathbar.h
index caee56c..1f7be88 100644
--- a/gtk/gtkpathbar.h
+++ b/gtk/gtkpathbar.h
@@ -25,7 +25,7 @@
 #error "Only <gtk/gtk.h> can be included directly."
 #endif
 
-#include <gtk/gtkstack.h>
+#include <gtk/gtkbox.h>
 
 G_BEGIN_DECLS
 
@@ -42,7 +42,7 @@ typedef struct _GtkPathBarPrivate GtkPathBarPrivate;
 
 struct _GtkPathBarClass
 {
-  GtkStackClass parent;
+  GtkBoxClass parent;
 
   /*< public >*/
 
@@ -59,7 +59,7 @@ struct _GtkPathBarClass
 
 struct _GtkPathBar
 {
-  GtkStack parent_instance;
+  GtkBox parent_instance;
 };
 
 GDK_AVAILABLE_IN_3_20
diff --git a/gtk/ui/gtkpathbar.ui b/gtk/ui/gtkpathbar.ui
index dcf9dfe..e9508da 100644
--- a/gtk/ui/gtkpathbar.ui
+++ b/gtk/ui/gtkpathbar.ui
@@ -12,7 +12,7 @@
       <class name="path-bar-overflow-popover"/>
     </style>
   </object>
-  <template class="GtkPathBar" parent="GtkStack">
+  <template class="GtkPathBar" parent="GtkBox">
     <property name="visible">true</property>
     <property name="valign">GTK_ALIGN_START</property>
     <property name="vexpand">false</property>
@@ -44,34 +44,6 @@
         </child>
       </object>
     </child>
-    <child>
-      <object class="GtkPathBarContainer" id="path_bar_2">
-        <property name="visible">true</property>
-        <child internal-child="overflow_button">
-          <object class="GtkMenuButton" id="overflow_button_2">
-            <property name="visible">true</property>
-            <property name="no-show-all">true</property>
-            <property name="popover">overflow_popover</property>
-            <signal name="clicked" handler="populate_overflow_popover" object="GtkPathBar" swapped="yes"/>
-            <child>
-              <object class="GtkImage">
-                <property name="visible">true</property>
-                <property name="icon_name">image-loading-symbolic</property>
-                <property name="icon_size">1</property>
-              </object>
-            </child>
-            <style>
-              <class name="flat"/>
-            </style>
-          </object>
-        </child>
-        <child internal-child="path_box">
-          <object class="GtkHidingBox" id="path_box_2">
-            <property name="visible">true</property>
-          </object>
-        </child>
-      </object>
-    </child>
     <style>
       <class name="path-bar"/>
     </style>


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