[Xfce4-commits] <xfce4-panel:master> Fix issue in systray size allocation with 1 row (bug #6809).

Nick Schermer noreply at xfce.org
Tue Nov 16 17:32:02 CET 2010


Updating branch refs/heads/master
         to 021bb3d5a31fefeb69f180ff479a2001cdf30412 (commit)
       from d023b4afdaa4c6916d8c57e2dec67dd115f1a47b (commit)

commit 021bb3d5a31fefeb69f180ff479a2001cdf30412
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Nov 16 17:29:17 2010 +0100

    Fix issue in systray size allocation with 1 row (bug #6809).

 plugins/systray/systray-box.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index 51c0177..810e10c 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -464,9 +464,24 @@ systray_box_size_allocate (GtkWidget     *widget,
   height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width;
 
   /* child size */
-  child_size = IS_HORIZONTAL (box) ? height : width;
-  child_size -= SPACING * (box->rows - 1);
-  child_size /= box->rows;
+  if (box->rows == 1)
+    {
+      child_size = IS_HORIZONTAL (box) ? width : height;
+      n = g_slist_length (box->childeren) - box->n_hidden_childeren;
+      child_size -= SPACING * MAX (n - 1, 0);
+      child_size /= n;
+
+      if (IS_HORIZONTAL (box))
+        y += MAX (height - child_size, 0) / 2;
+      else
+        x += MAX (width - child_size, 0) / 2;
+    }
+  else
+    {
+      child_size = IS_HORIZONTAL (box) ? height : width;
+      child_size -= SPACING * (box->rows - 1);
+      child_size /= box->rows;
+    }
 
   /* don't allocate zero width icon */
   if (child_size < 1)



More information about the Xfce4-commits mailing list