[Xfce4-commits] <xfce4-panel:devel> Propertly allocate the buttons when the orientation is vertical.
Nick Schermer
nick at xfce.org
Tue Aug 11 20:26:40 CEST 2009
Updating branch refs/heads/devel
to 28b9687eef10a0e01c2c19b2b34ec7c8e45bd89a (commit)
from afcf36dcb8be9d3d5dcac3ef55486de4f1b1f49f (commit)
commit 28b9687eef10a0e01c2c19b2b34ec7c8e45bd89a
Author: Nick Schermer <nick at xfce.org>
Date: Sat Feb 7 20:23:42 2009 +0100
Propertly allocate the buttons when the orientation is vertical.
plugins/tasklist/tasklist-widget.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 90a7f89..b896bad 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -487,8 +487,16 @@ xfce_tasklist_size_allocate (GtkWidget *widget,
continue;
/* calculate the child position */
- child_allocation.x = allocation->x + (i / rows) * width;
- child_allocation.y = allocation->y + (i % rows) * height;
+ if (tasklist->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ child_allocation.x = allocation->x + (i / rows) * width;
+ child_allocation.y = allocation->y + (i % rows) * height;
+ }
+ else
+ {
+ child_allocation.x = allocation->x + (i % rows) * width;
+ child_allocation.y = allocation->y + (i / rows) * height;
+ }
/* allocate the child */
gtk_widget_size_allocate (child->button, &child_allocation);
@@ -1481,4 +1489,10 @@ xfce_tasklist_set_orientation (XfceTasklist *tasklist,
GtkOrientation orientation)
{
panel_return_if_fail (XFCE_IS_TASKLIST (tasklist));
+
+ if (tasklist->orientation != orientation)
+ {
+ tasklist->orientation = orientation;
+ gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+ }
}
More information about the Xfce4-commits
mailing list