[gtk+] Revert "levelbar: start filling from the bottom"



commit 67e44e6a4ee5f9f404e98649f5f89c9379466012
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Sep 19 15:22:54 2012 -0400

    Revert "levelbar: start filling from the bottom"
    
    This reverts commit 4b3ed75f7d14bc10a045aeb4a3873ff36eee966a.
    
    I didn't see https://bugzilla.gnome.org/show_bug.cgi?id=684288 - it
    makes more sense to properly fix this for the next cycle.

 gtk/gtklevelbar.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index 72ee80f..d82d385 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -339,14 +339,9 @@ gtk_level_bar_draw_fill_continuous (GtkLevelBar           *self,
     (self->priv->max_value - self->priv->min_value);
 
   if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-    {
-      block_area.width = (gint) floor (block_area.width * fill_percentage);
-    }
+    block_area.width = (gint) floor (block_area.width * fill_percentage);
   else
-    {
-      block_area.height = (gint) floor (block_area.height * fill_percentage);
-      block_area.y += base_area.height - block_area.height;
-    }
+    block_area.height = (gint) floor (block_area.height * fill_percentage);
 
   gtk_render_background (context, cr, block_area.x, block_area.y,
                          block_area.width, block_area.height);
@@ -397,7 +392,6 @@ gtk_level_bar_draw_fill_discrete (GtkLevelBar           *self,
     {
       block_draw_width = MAX (block_draw_width, block_area.width - block_margin.left - block_margin.right);
       block_area.x += block_margin.left;
-      block_area.y += block_area.height - block_draw_height;
     }
 
   for (idx = 0; idx < num_blocks; idx++)
@@ -405,7 +399,7 @@ gtk_level_bar_draw_fill_discrete (GtkLevelBar           *self,
       if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
         block_area.x += block_margin.left;
       else
-        block_area.y -= block_margin.bottom;
+        block_area.y += block_margin.top;
 
       if (idx > num_filled - 1)
         gtk_style_context_add_class (context, STYLE_CLASS_EMPTY_FILL_BLOCK);
@@ -420,7 +414,7 @@ gtk_level_bar_draw_fill_discrete (GtkLevelBar           *self,
       if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
         block_area.x += block_draw_width + block_margin.right;
       else
-        block_area.y -= block_draw_height + block_margin.top;
+        block_area.y += block_draw_height + block_margin.bottom;
     }
 
   gtk_style_context_restore (context);



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