[gtk+] cellrendererprogress: don't force drawing inside the border



commit 73d9ca67e6ea1021ebee4351a9cf0a10b07178da
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri May 6 14:33:00 2011 -0400

    cellrendererprogress: don't force drawing inside the border
    
    The progressbar is composed by two different rendered areas: the trough
    (i.e. the non-filled part of the bar) and the bar itself.
    
    The bar should be able to fill the whole height/width of the trough
    without resorting to nasty hacks in the theme, and we can control the
    amount of space between the bar and the trough with the padding already.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=649593

 gtk/gtkcellrendererprogress.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcellrendererprogress.c b/gtk/gtkcellrendererprogress.c
index 82abe68..caa26d1 100644
--- a/gtk/gtkcellrendererprogress.c
+++ b/gtk/gtkcellrendererprogress.c
@@ -548,7 +548,7 @@ gtk_cell_renderer_progress_render (GtkCellRenderer      *cell,
   GtkCellRendererProgress *cellprogress = GTK_CELL_RENDERER_PROGRESS (cell);
   GtkCellRendererProgressPrivate *priv= cellprogress->priv;
   GtkStyleContext *context;
-  GtkBorder padding, border;
+  GtkBorder padding;
   PangoLayout *layout;
   PangoRectangle logical_rect;
   gint x, y, w, h, x_pos, y_pos, bar_position, bar_size, start, full_size;
@@ -571,13 +571,12 @@ gtk_cell_renderer_progress_render (GtkCellRenderer      *cell,
   gtk_render_background (context, cr, x, y, w, h);
   gtk_render_frame (context, cr, x, y, w, h);
 
-  gtk_style_context_get_border (context, GTK_STATE_FLAG_NORMAL, &border);
   gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &padding);
 
-  x += border.left + padding.left;
-  y += border.top + padding.top;
-  w -= border.left + border.right + padding.left + padding.right;
-  h -= border.top + border.bottom + padding.top + padding.bottom;
+  x += padding.left;
+  y += padding.top;
+  w -= padding.left + padding.right;
+  h -= padding.top + padding.bottom;
 
   gtk_style_context_restore (context);
 



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