[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-github> itembar: fixed layout errors with wrapping separators
Andrzej
noreply at xfce.org
Mon Dec 12 11:40:23 CET 2011
Updating branch refs/heads/andrzejr/deskbar-github
to 157ae1cc5ccac7bcf13770d59d951484d5806f45 (commit)
from 94c8124cf50a79b688d33ccc324e9ab0aef6bc37 (commit)
commit 157ae1cc5ccac7bcf13770d59d951484d5806f45
Author: Andrzej <ndrwrdck at gmail.com>
Date: Sun Nov 20 01:27:24 2011 +0900
itembar: fixed layout errors with wrapping separators
panel/panel-itembar.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c
index 9ea21aa..ee11806 100644
--- a/panel/panel-itembar.c
+++ b/panel/panel-itembar.c
@@ -312,14 +312,15 @@ static void
panel_itembar_column_wrap (PanelItembar *itembar,
gint *column_row,
gint *x,
- gint *y)
+ gint *y,
+ gint start)
{
*column_row = 0;
if (itembar->horizontal) {
- *y = 0;
+ *y = start;
*x += itembar->size / itembar->nrows;
} else {
- *x = 0;
+ *x = start;
*y += itembar->size / itembar->nrows;
}
}
@@ -329,7 +330,8 @@ static void
panel_itembar_column_next (PanelItembar *itembar,
gint *column_row,
gint *x,
- gint *y)
+ gint *y,
+ gint start)
{
(*column_row)++;
if (*column_row < (gint) itembar->nrows) {
@@ -337,7 +339,7 @@ panel_itembar_column_next (PanelItembar *itembar,
*y += itembar->size / itembar->nrows;
else
*x += itembar->size / itembar->nrows;
- } else panel_itembar_column_wrap(itembar, column_row, x, y);
+ } else panel_itembar_column_wrap(itembar, column_row, x, y, start);
}
@@ -451,7 +453,7 @@ panel_itembar_size_allocate (GtkWidget *widget,
gint expand_length_avail, expand_length_req;
gint shrink_length_avail, shrink_length_req;
gint length;
- gint x, y;
+ gint x, y, start;
gboolean expand_children_fit;
gint new_length;
gint child_length;
@@ -527,9 +529,15 @@ panel_itembar_size_allocate (GtkWidget *widget,
x = allocation->x + border_width;
y = allocation->y + border_width;
if (itembar->horizontal)
- y += row * itembar->size;
+ {
+ y += row * itembar->size;
+ start = y;
+ }
else
- x += row * itembar->size;
+ {
+ x += row * itembar->size;
+ start = x;
+ }
/* whether the expandable items fit on this row; we use this
* as a fast-path when there are expanding items on a panel with
@@ -575,11 +583,11 @@ panel_itembar_size_allocate (GtkWidget *widget,
child_alloc.y = y;
child_alloc.height = itembar->size / itembar->nrows;
child_alloc.width = itembar->size / itembar->nrows;
- panel_itembar_column_next(itembar, &column_row, &x, &y);
+ panel_itembar_column_next(itembar, &column_row, &x, &y, start);
gtk_widget_size_allocate (child->widget, &child_alloc);
continue;
} else
- if (column_row > 0) panel_itembar_column_wrap(itembar, &column_row, &x, &y);
+ if (column_row > 0) panel_itembar_column_wrap(itembar, &column_row, &x, &y, start);
gtk_widget_get_child_requisition (child->widget, &child_req);
More information about the Xfce4-commits
mailing list