Author: jasper
Date: 2007-06-24 20:43:02 +0000 (Sun, 24 Jun 2007)
New Revision: 25856

Modified:
   xfce4-panel/branches/xfce_4_4/NEWS
   xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.c
   xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.h
   xfce4-panel/branches/xfce_4_4/panel/panel-properties.c
Log:
Fix expansion of items a non-full-width panel.

Modified: xfce4-panel/branches/xfce_4_4/NEWS
===================================================================
--- xfce4-panel/branches/xfce_4_4/NEWS  2007-06-24 20:38:38 UTC (rev 25855)
+++ xfce4-panel/branches/xfce_4_4/NEWS  2007-06-24 20:43:02 UTC (rev 25856)
@@ -2,6 +2,7 @@
 ====================
 4.4.2
 =====
+- Fix expansion of items a non-full-width panel. (Jasper)
 - Make sure tooltips are set for more than 1 clock instance (bug #3109).
   (Jasper)
 - Fix area that is off-limits to other windows (_NET_WM_STRUT hints) for a

Modified: xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.c
===================================================================
--- xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.c  2007-06-24 
20:38:38 UTC (rev 25855)
+++ xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.c  2007-06-24 
20:43:02 UTC (rev 25856)
@@ -75,6 +75,7 @@
     
     int drop_index;
     guint raised:1;
+    guint expand_allowed:1;
 };
 
 struct _XfceItembarChild
@@ -313,6 +314,8 @@
     priv->event_window     = NULL;
     priv->drag_highlight   = NULL;
     priv->drop_index       = -1;
+    priv->raised           = FALSE;
+    priv->expand_allowed   = FALSE;
 }
 
 /* GObject */
@@ -497,7 +500,7 @@
         {
             height = bar_height;
             
-            if (child->expand)
+            if (child->expand && priv->expand_allowed)
             {
                 n_expand++;
                 max_expand = MAX (max_expand, width);
@@ -511,7 +514,7 @@
         {
             width = bar_height;
             
-            if (child->expand)
+            if (child->expand && priv->expand_allowed)
             {
                 n_expand++;
                 max_expand = MAX (max_expand, height);
@@ -524,7 +527,7 @@
 
         props[i].allocation.width = width;
         props[i].allocation.height = height;
-        props[i].expand = child->expand;
+        props[i].expand = (child->expand && priv->expand_allowed);
     }
 
     total_expand = expand_width;
@@ -1009,6 +1012,30 @@
 }
 
 /**
+ * xfce_itembar_set_allow_expand:
+ * @allow : %TRUE when the expansion is allowed.
+ *
+ * Set whether the 'expand' child property is honored.
+ *
+ * See also: xfce_itembar_set_child_expand().
+ **/
+void
+xfce_itembar_set_allow_expand (XfceItembar *itembar,
+                               gboolean     allow)
+{
+    XfceItembarPrivate *priv;
+
+    g_return_if_fail (XFCE_IS_ITEMBAR (itembar));
+
+    priv = XFCE_ITEMBAR_GET_PRIVATE (itembar);
+
+    priv->expand_allowed = allow;
+    gtk_widget_queue_resize (GTK_WIDGET(itembar));
+}
+
+
+
+/**
  * xfce_itembar_get_orientation:
  * @itembar : an #XfceItembar
  *

Modified: xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.h
===================================================================
--- xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.h  2007-06-24 
20:38:38 UTC (rev 25855)
+++ xfce4-panel/branches/xfce_4_4/libxfce4panel/xfce-itembar.h  2007-06-24 
20:43:02 UTC (rev 25856)
@@ -66,6 +66,9 @@
 GtkWidget *xfce_itembar_new                    (GtkOrientation orientation);
 
 
+void xfce_itembar_set_allow_expand             (XfceItembar * itembar,
+                                                gboolean allow);
+
 void xfce_itembar_set_orientation              (XfceItembar * itembar,
                                                 GtkOrientation orientation);
 

Modified: xfce4-panel/branches/xfce_4_4/panel/panel-properties.c
===================================================================
--- xfce4-panel/branches/xfce_4_4/panel/panel-properties.c      2007-06-24 
20:38:38 UTC (rev 25855)
+++ xfce4-panel/branches/xfce_4_4/panel/panel-properties.c      2007-06-24 
20:43:02 UTC (rev 25856)
@@ -969,6 +969,7 @@
     
     if (priv->full_width > XFCE_PANEL_NORMAL_WIDTH)
     {
+        xfce_itembar_set_allow_expand (XFCE_ITEMBAR (priv->itembar), TRUE);
         if (xfce_screen_position_is_horizontal (priv->screen_position))
         {
             int w;
@@ -1199,10 +1200,14 @@
             {
                 case XFCE_PANEL_NORMAL_WIDTH:
                     w = h = -1;
+                    xfce_itembar_set_allow_expand (XFCE_ITEMBAR 
(priv->itembar),
+                                                   FALSE);
                     break;
                     
                 case XFCE_PANEL_FULL_WIDTH:
                 case XFCE_PANEL_SPAN_MONITORS:
+                    xfce_itembar_set_allow_expand (XFCE_ITEMBAR 
(priv->itembar), 
+                                                   TRUE);
                     if (xfce_screen_position_is_horizontal (
                                 priv->screen_position))
                     {

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to