[Xfce4-commits] r29741 - in xfce4-panel/trunk: . plugins/separator

Nick Schermer nick at xfce.org
Thu Apr 9 21:30:00 CEST 2009


Author: nick
Date: 2009-04-09 19:30:00 +0000 (Thu, 09 Apr 2009)
New Revision: 29741

Modified:
   xfce4-panel/trunk/NEWS
   xfce4-panel/trunk/plugins/separator/separator.c
Log:
Fix drawing dots mode of the seperator plugin in a vertical panel (bug #5162).


Modified: xfce4-panel/trunk/NEWS
===================================================================
--- xfce4-panel/trunk/NEWS	2009-04-09 19:18:52 UTC (rev 29740)
+++ xfce4-panel/trunk/NEWS	2009-04-09 19:30:00 UTC (rev 29741)
@@ -9,6 +9,7 @@
 - Add icon-name fallback to the show desktop plugin (bug #5117).
 - Disconnect the icon theme changed signal from a launcher when it
   is destroyed to avoid crash when the icon theme changes.
+- Fix drawing dots mode of the seperator plugin in a vertical panel (bug #5162).
 
 
 4.6.0

Modified: xfce4-panel/trunk/plugins/separator/separator.c
===================================================================
--- xfce4-panel/trunk/plugins/separator/separator.c	2009-04-09 19:18:52 UTC (rev 29740)
+++ xfce4-panel/trunk/plugins/separator/separator.c	2009-04-09 19:30:00 UTC (rev 29741)
@@ -483,9 +483,11 @@
 separator_paint_dots (GtkWidget *widget, GdkRectangle * area, Separator *sep)
 {
     GdkBitmap *dark_bmap, *mid_bmap, *light_bmap;
-    gint       x, y, w, h, rows;
-    guint      width  = widget->allocation.width;
-    guint      height = widget->allocation.height;
+    gint       x, y, w, h, rows, cols;
+    gint       width, height;
+    
+    width  = widget->allocation.width;
+    height = widget->allocation.height;
 
     dark_bmap = gdk_bitmap_create_from_data (widget->window, 
                                              (const gchar*) dark_bits,
@@ -506,10 +508,19 @@
                                    area);
     }
 
-    rows = MAX (height / 6, 1);
+    if (xfce_panel_plugin_get_orientation (sep->plugin) == GTK_ORIENTATION_HORIZONTAL)
+      {
+        rows = MAX (height / 6, 1);
+        w = 6;
+        h = rows * 6;
+      }
+    else
+      {
+        cols = MAX (width / 6, 1);
+        h = 6;
+        w = cols * 6;
+      }
 
-    w = 6;
-    h = rows * 6;
     x = (width - w) / 2;
     y = (height - h) / 2;
 




More information about the Xfce4-commits mailing list