[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-github> itembar: updated for CW rotation in vertical mode.

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


Updating branch refs/heads/andrzejr/deskbar-github
         to ad6c78cd127d8dab2e64d75dcefe1967a3d66f3b (commit)
       from 0b8900bf7f5645b9a5f0872b27e5d333ce68c3ca (commit)

commit ad6c78cd127d8dab2e64d75dcefe1967a3d66f3b
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Mon Dec 12 02:49:33 2011 +0900

    itembar: updated for CW rotation in vertical mode.

 panel/panel-itembar.c |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c
index 16c37a6..77ad6a3 100644
--- a/panel/panel-itembar.c
+++ b/panel/panel-itembar.c
@@ -596,9 +596,14 @@ panel_itembar_size_allocate (GtkWidget     *widget,
             child_alloc.height = itembar->size / itembar->nrows;
             child_alloc.width = itembar->size / itembar->nrows;
             panel_itembar_column_next(itembar, &column_row, &x, &y, start);
-            if (0) //(VERTICAL (itembar)) // flip upside-down
+#if 0
+            if (VERTICAL (itembar)) // flip upside-down
               child_alloc.y = 2*allocation->y + allocation->height
                 - child_alloc.y - child_alloc.height;
+#endif
+            if (VERTICAL (itembar)) // flip right-left
+              child_alloc.x = 2*allocation->x + allocation->width
+                - child_alloc.x - child_alloc.width;
             gtk_widget_size_allocate (child->widget, &child_alloc);
             continue;
           } else
@@ -632,9 +637,14 @@ panel_itembar_size_allocate (GtkWidget     *widget,
                   child_alloc.width = child_alloc.height = 0;
                 }
 
-              if (0) //(VERTICAL (itembar)) //flip upside-down
+#if 0
+              if (VERTICAL (itembar)) //flip upside-down
                 child_alloc.y = 2*allocation->y + allocation->height
                   - child_alloc.y - child_alloc.height;
+#endif
+              if (VERTICAL (itembar)) //flip right-left
+                child_alloc.x = 2*allocation->x + allocation->width
+                  - child_alloc.x - child_alloc.width;
               gtk_widget_size_allocate (child->widget, &child_alloc);
 
               /* stop and continue to the next row */
@@ -689,9 +699,14 @@ panel_itembar_size_allocate (GtkWidget     *widget,
               y += child_alloc.height;
             }
 
-          if (0) //(VERTICAL (itembar)) //flip upside-down
+#if 0
+          if (VERTICAL (itembar)) //flip upside-down
             child_alloc.y = 2*allocation->y + allocation->height
               - child_alloc.y - child_alloc.height;
+#endif
+          if (VERTICAL (itembar)) //flip right-left
+            child_alloc.x = 2*allocation->x + allocation->width
+              - child_alloc.x - child_alloc.width;
           gtk_widget_size_allocate (child->widget, &child_alloc);
 
           if (HORIZONTAL (itembar))
@@ -754,11 +769,18 @@ panel_itembar_expose_event (GtkWidget      *widget,
               x2 = x1 + itembar->size;
             }
           alloc = &widget->allocation;
-          if (0) //(VERTICAL (itembar)) //flip upside-down
+#if 0
+          if (VERTICAL (itembar)) //flip upside-down
             {
               y1 = 2 * alloc->y + alloc->height - y1;
               y2 = 2 * alloc->y + alloc->height - y2;
             }
+#endif
+          if (VERTICAL (itembar)) //flip right-left
+            {
+              x1 = 2 * alloc->x + alloc->width - x1;
+              x2 = 2 * alloc->x + alloc->width - x2;
+            }
         }
       cairo_move_to (cr, x1, y1);
       cairo_line_to (cr, x2, y2);
@@ -1115,10 +1137,16 @@ panel_itembar_get_drop_index (PanelItembar *itembar,
         {
           x2 = x;
           y2 = y;
-          if (0) //(VERTICAL (itembar)) //flip upside-down
+#if 0
+          if (VERTICAL (itembar)) //flip upside-down
             {
               y2 = 2 * alloc->y + alloc->height - y;
             }
+#endif
+          if (VERTICAL (itembar)) //flip right-left
+            {
+              x2 = 2 * alloc->x + alloc->width - x;
+            }
           if (y2 < alloc->y) break;
           if (child->small)
             {


More information about the Xfce4-commits mailing list