]> Pileus Git - ~andy/gtk/commitdiff
cellrendererprogress: don't force drawing inside the border
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 6 May 2011 18:33:00 +0000 (14:33 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 6 May 2011 19:10:43 +0000 (15:10 -0400)
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

index 82abe680f0c6443e704061b8716488f3de392dae..caa26d16ba51d4e6fb4e66758d4b8170b4e70bad 100644 (file)
@@ -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);