[gtk+/wip/checked: 7/9] gtk: Don't use gtk_render_activity()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/checked: 7/9] gtk: Don't use gtk_render_activity()
- Date: Fri, 15 Aug 2014 02:08:02 +0000 (UTC)
commit 047e793d3fe41fd2ae60a9c804a1c2e2e5e01756
Author: Benjamin Otte <otte redhat com>
Date: Fri Aug 15 01:58:49 2014 +0200
gtk: Don't use gtk_render_activity()
... in places where we draw a background. This was changed for GTK 3.0.0
to allow animations, but these days it doesn't make sense anymore to use
gtk_render_activity() for backgrounds.
gtk/deprecated/gtkstyle.c | 11 +++--------
gtk/gtkcellrendererprogress.c | 15 ++++++++-------
gtk/gtkentry.c | 4 ++--
gtk/gtkprogressbar.c | 6 ++++--
gtk/gtkrange.c | 5 ++---
5 files changed, 19 insertions(+), 22 deletions(-)
---
diff --git a/gtk/deprecated/gtkstyle.c b/gtk/deprecated/gtkstyle.c
index d610a34..7a001bb 100644
--- a/gtk/deprecated/gtkstyle.c
+++ b/gtk/deprecated/gtkstyle.c
@@ -2045,15 +2045,10 @@ gtk_default_draw_box (GtkStyle *style,
cairo_save (cr);
- if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_PROGRESSBAR))
- gtk_render_activity (context, cr, x, y, width, height);
- else
- {
- gtk_render_background (context, cr, x, y, width, height);
+ gtk_render_background (context, cr, x, y, width, height);
- if (shadow_type != GTK_SHADOW_NONE)
- gtk_render_frame (context, cr, x, y, width, height);
- }
+ if (shadow_type != GTK_SHADOW_NONE)
+ gtk_render_frame (context, cr, x, y, width, height);
cairo_restore (cr);
gtk_style_context_restore (context);
diff --git a/gtk/gtkcellrendererprogress.c b/gtk/gtkcellrendererprogress.c
index e452a9a..f8cb51d 100644
--- a/gtk/gtkcellrendererprogress.c
+++ b/gtk/gtkcellrendererprogress.c
@@ -626,15 +626,16 @@ gtk_cell_renderer_progress_render (GtkCellRenderer *cell,
clip.y = bar_position;
}
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
-
if (bar_size > 0)
- gtk_render_activity (context, cr,
- clip.x, clip.y,
- clip.width, clip.height);
+ {
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
- gtk_style_context_restore (context);
+ gtk_render_background (context, cr, clip.x, clip.y, clip.width, clip.height);
+ gtk_render_frame (context, cr, clip.x, clip.y, clip.width, clip.height);
+
+ gtk_style_context_restore (context);
+ }
if (priv->label)
{
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 5cdb3d9..d704c97 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3941,8 +3941,8 @@ gtk_entry_draw_progress (GtkWidget *widget,
return;
gtk_entry_prepare_context_for_progress (entry, context);
- gtk_render_activity (context, cr,
- x, y, width, height);
+ gtk_render_background (context, cr, x, y, width, height);
+ gtk_render_frame (context, cr, x, y, width, height);
gtk_style_context_restore (context);
}
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 5cdda73..b2b2496 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -784,7 +784,8 @@ gtk_progress_bar_paint_activity (GtkProgressBar *pbar,
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
}
- gtk_render_activity (context, cr, area.x, area.y, area.width, area.height);
+ gtk_render_background (context, cr, area.x, area.y, area.width, area.height);
+ gtk_render_frame (context, cr, area.x, area.y, area.width, area.height);
gtk_style_context_restore (context);
}
@@ -849,7 +850,8 @@ gtk_progress_bar_paint_continuous (GtkProgressBar *pbar,
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
}
- gtk_render_activity (context, cr, area.x, area.y, area.width, area.height);
+ gtk_render_background (context, cr, area.x, area.y, area.width, area.height);
+ gtk_render_frame (context, cr, area.x, area.y, area.width, area.height);
gtk_style_context_restore (context);
}
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index c65f58f..6a2f303 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2174,9 +2174,8 @@ gtk_range_draw (GtkWidget *widget,
fill_y += priv->trough.height - fill_height;
}
- gtk_render_activity (context, cr,
- fill_x, fill_y,
- fill_width, fill_height);
+ gtk_render_background (context, cr, fill_x, fill_y, fill_width, fill_height);
+ gtk_render_frame (context, cr, fill_x, fill_y, fill_width, fill_height);
gtk_style_context_restore (context);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]