[Xfce4-commits] <xfce4-panel:master> Pager: Fixed workspace ordering in the vertical mode.
Nick Schermer
noreply at xfce.org
Fri Feb 24 16:42:03 CET 2012
Updating branch refs/heads/master
to 7fdf98c87f22f6e1b55e89537d8be6b206e42df1 (commit)
from 759b70b9e1f5c4686647722605f98ea338652cea (commit)
commit 7fdf98c87f22f6e1b55e89537d8be6b206e42df1
Author: Andrzej <ndrwrdck at gmail.com>
Date: Sun Jan 22 23:28:13 2012 +0900
Pager: Fixed workspace ordering in the vertical mode.
This is to match the workspace ordering in WNCK and button pagers.
plugins/pager/pager-buttons.c | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/plugins/pager/pager-buttons.c b/plugins/pager/pager-buttons.c
index b0a07fa..040e58d 100644
--- a/plugins/pager/pager-buttons.c
+++ b/plugins/pager/pager-buttons.c
@@ -351,10 +351,11 @@ pager_buttons_rebuild_idle (gpointer user_data)
cols++;
}
- if (pager->orientation != GTK_ORIENTATION_HORIZONTAL)
- SWAP_INTEGER (rows, cols);
+ if (pager->orientation == GTK_ORIENTATION_HORIZONTAL)
+ gtk_table_resize (GTK_TABLE (pager), rows, cols);
+ else
+ gtk_table_resize (GTK_TABLE (pager), cols, rows);
- gtk_table_resize (GTK_TABLE (pager), rows, cols);
panel_plugin = gtk_widget_get_ancestor (GTK_WIDGET (pager), XFCE_TYPE_PANEL_PLUGIN);
@@ -392,8 +393,17 @@ pager_buttons_rebuild_idle (gpointer user_data)
gtk_container_add (GTK_CONTAINER (button), label);
gtk_widget_show (label);
- row = n % cols;
- col = n / cols;
+ if (pager->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ row = n % cols;
+ col = n / cols;
+ }
+ else
+ {
+ row = n / cols;
+ col = n % cols;
+ }
+
gtk_table_attach (GTK_TABLE (pager), button,
row, row + 1, col, col + 1,
@@ -428,8 +438,16 @@ pager_buttons_rebuild_idle (gpointer user_data)
pager->buttons = g_slist_prepend (pager->buttons, button);
- row = n % cols;
- col = n / cols;
+ if (pager->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ row = n % cols;
+ col = n / cols;
+ }
+ else
+ {
+ row = n / cols;
+ col = n % cols;
+ }
gtk_table_attach (GTK_TABLE (pager), button,
row, row + 1, col, col + 1,
More information about the Xfce4-commits
mailing list