[gtk+] levelbar: Make discrete levelbars behave as before



commit 61307deaf750569a833c093c219d1af1e9ceff6b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 5 11:53:50 2016 +0100

    levelbar: Make discrete levelbars behave as before
    
    During the gadget conversion, the drawing of discrete levelbars
    was unintentionally changed to draw a wide trough but narrow
    blocks, which does not look great. So go back to the previous
    way of drawing things.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761428

 gtk/gtklevelbar.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index f819543..7b50585 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -496,9 +496,15 @@ gtk_level_bar_allocate_trough_discrete (GtkLevelBar *self,
   num_blocks = gtk_level_bar_get_num_blocks (self);
 
   if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-    block_width = MAX (block_width, (gint) floor (allocation->width / num_blocks));
+    {
+      block_width = MAX (block_width, (gint) floor (allocation->width / num_blocks));
+      block_height = allocation->height;
+    }
   else
-    block_height = MAX (block_height, (gint) floor (allocation->height / num_blocks));
+    {
+      block_width = allocation->width;
+      block_height = MAX (block_height, (gint) floor (allocation->height / num_blocks));
+    }
 
   block_area.x = allocation->x;
   block_area.y = allocation->y;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]