[Xfce4-commits] <xfce4-panel:andrzejr/deskbar2> pager-buttons: fixed workspace ordering in the vertical mode.

Andrzej noreply at xfce.org
Sun Jan 22 15:34:03 CET 2012


Updating branch refs/heads/andrzejr/deskbar2
         to 27e2580149196c1a176838800967f42b37274fd5 (commit)
       from 9325971e348c0136aa49c23e4b2af1d480062883 (commit)

commit 27e2580149196c1a176838800967f42b37274fd5
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Jan 22 23:28:13 2012 +0900

    pager-buttons: 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