diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-01 02:36:38 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-01 03:28:35 +0800 |
commit | 7c2e05401bfed572a7253d3da24a30306497d570 (patch) | |
tree | 5c9f30e506f4ccaf2a13d140426b3be8fe1780ed /widgets/text | |
parent | b15e0d6df6e3e626a7c8b33fd1d0504fca7ca5b5 (diff) | |
download | gsoc2013-evolution-7c2e05401bfed572a7253d3da24a30306497d570.tar gsoc2013-evolution-7c2e05401bfed572a7253d3da24a30306497d570.tar.gz gsoc2013-evolution-7c2e05401bfed572a7253d3da24a30306497d570.tar.bz2 gsoc2013-evolution-7c2e05401bfed572a7253d3da24a30306497d570.tar.lz gsoc2013-evolution-7c2e05401bfed572a7253d3da24a30306497d570.tar.xz gsoc2013-evolution-7c2e05401bfed572a7253d3da24a30306497d570.tar.zst gsoc2013-evolution-7c2e05401bfed572a7253d3da24a30306497d570.zip |
Avoid GtkStyle-based "paint" functions.
Use GtkStyleContext-based "render" functions instead.
gtk_paint_arrow() --> gtk_render_arrow()
gtk_paint_box() --> gtk_render_background()
gtk_paint_expander() --> gtk_render_expander()
gtk_paint_flat_box() --> gtk_render_background()
gtk_paint_shadow() --> gtk_render_frame()
gtk_paint_vline() --> gtk_render_line()
Diffstat (limited to 'widgets/text')
-rw-r--r-- | widgets/text/e-reflow.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index 350550fd80..faad196c83 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -1246,10 +1246,12 @@ e_reflow_draw (GnomeCanvasItem *item, gint width, gint height) { - GtkStyle *style; + GtkStyleContext *style_context; + GtkWidget *widget; gint x_rect, y_rect, width_rect, height_rect; gdouble running_width; EReflow *reflow = E_REFLOW (item); + GdkRGBA color; gint i; gdouble column_width; @@ -1266,25 +1268,32 @@ e_reflow_draw (GnomeCanvasItem *item, i /= column_width + E_REFLOW_FULL_GUTTER; running_width += i * (column_width + E_REFLOW_FULL_GUTTER); - style = gtk_widget_get_style (GTK_WIDGET (item->canvas)); + widget = GTK_WIDGET (item->canvas); + style_context = gtk_widget_get_style_context (widget); + + cairo_save (cr); + + gtk_style_context_get_background_color ( + style_context, GTK_STATE_FLAG_ACTIVE, &color); + gdk_cairo_set_source_rgba (cr, &color); for (; i < reflow->column_count; i++) { if (running_width > x + width) break; x_rect = running_width; - gtk_paint_flat_box ( - style, - cr, - GTK_STATE_ACTIVE, - GTK_SHADOW_NONE, - GTK_WIDGET (item->canvas), - "reflow", - x_rect - x, - y_rect - y, - width_rect, - height_rect); + + gtk_render_background ( + style_context, cr, + (gdouble) x_rect - x, + (gdouble) y_rect - y, + (gdouble) width_rect, + (gdouble) height_rect); + running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } + + cairo_restore (cr); + if (reflow->column_drag) { GtkAdjustment *adjustment; GtkLayout *layout; @@ -1311,7 +1320,10 @@ e_reflow_draw (GnomeCanvasItem *item, running_width += i * (column_width + E_REFLOW_FULL_GUTTER); cairo_save (cr); - gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]); + + gtk_style_context_get_color ( + style_context, GTK_STATE_FLAG_NORMAL, &color); + gdk_cairo_set_source_rgba (cr, &color); for (; i < reflow->column_count; i++) { if (running_width > x + width) @@ -1326,6 +1338,7 @@ e_reflow_draw (GnomeCanvasItem *item, cairo_fill (cr); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } + cairo_restore (cr); } } |