[Xfce4-commits] <xfce4-panel:master> Restart tray allocation if number of rows overflows (bug #7055).
Nick Schermer
noreply at xfce.org
Mon Jan 3 18:06:01 CET 2011
Updating branch refs/heads/master
to 7659c5bf972ba6b1671f380342c77d8f454b04d4 (commit)
from dd56e06c5e3068821bf286937bb8752d70c6d018 (commit)
commit 7659c5bf972ba6b1671f380342c77d8f454b04d4
Author: Nick Schermer <nick at xfce.org>
Date: Mon Jan 3 18:04:39 2011 +0100
Restart tray allocation if number of rows overflows (bug #7055).
plugins/systray/systray-box.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index c8ba2f8..1de3a30 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -495,17 +495,31 @@ systray_box_size_allocate (GtkWidget *widget,
goto restart_allocation;
}
- /* TODO maybe restart allocating with row_size-- if new row
- * doesn't fit? */
if (box->horizontal)
{
x = x_start;
y += row_size + SPACING;
+
+ if (y > y_end)
+ {
+ /* we overflow the number of rows, restart
+ * allocation with 1px smaller icons */
+ row_size--;
+ goto restart_allocation;
+ }
}
else
{
y = y_start;
x += row_size + SPACING;
+
+ if (x > x_end)
+ {
+ /* we overflow the number of rows, restart
+ * allocation with 1px smaller icons */
+ row_size--;
+ goto restart_allocation;
+ }
}
}
More information about the Xfce4-commits
mailing list