[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-github> pager-buttons: fixed ordering of buttons in vertical mode (unrelated to deskbar mode)

Andrzej noreply at xfce.org
Mon Dec 12 11:40:25 CET 2011


Updating branch refs/heads/andrzejr/deskbar-github
         to 460dac040e62ddbd2f345ada96fd6b7686045ea5 (commit)
       from 5087fd4e26b84927ce3b00ec25becefd5c915586 (commit)

commit 460dac040e62ddbd2f345ada96fd6b7686045ea5
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Mon Nov 21 16:50:35 2011 +0900

    pager-buttons: fixed ordering of buttons in vertical mode (unrelated to deskbar mode)

 plugins/pager/pager-buttons.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/plugins/pager/pager-buttons.c b/plugins/pager/pager-buttons.c
index b0a07fa..4d773f0 100644
--- a/plugins/pager/pager-buttons.c
+++ b/plugins/pager/pager-buttons.c
@@ -392,8 +392,16 @@ 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
+            {
+              col = n % rows;
+              row = n / rows;
+            }
 
           gtk_table_attach (GTK_TABLE (pager), button,
                             row, row + 1, col, col + 1,
@@ -428,8 +436,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
+            {
+              col = n % rows;
+              row = n / rows;
+            }
 
           gtk_table_attach (GTK_TABLE (pager), button,
                             row, row + 1, col, col + 1,


More information about the Xfce4-commits mailing list