[gnome-control-center] display: Drop deprecated API usage on FooScrollArea painting
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] display: Drop deprecated API usage on FooScrollArea painting
- Date: Fri, 5 Dec 2014 15:15:23 +0000 (UTC)
commit 30590061fce731a01109e14f2729c8a66988e1d2
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Nov 25 17:47:11 2014 +0100
display: Drop deprecated API usage on FooScrollArea painting
This achieves a very similar result (darkening the background color)
without having to peek into the style context. Note that the stroke
is removed because it isn't really visible anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=740986
panels/display/cc-display-panel.c | 27 ++-------------------------
1 files changed, 2 insertions(+), 25 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index ee12793..b03fe4f 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -1332,38 +1332,15 @@ paint_background (FooScrollArea *area,
cairo_t *cr)
{
GdkRectangle viewport;
- GtkWidget *widget;
- GtkStyleContext *context;
- GdkRGBA fg, bg;
-
- widget = GTK_WIDGET (area);
foo_scroll_area_get_viewport (area, &viewport);
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
- gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
-
- cairo_set_source_rgba (cr,
- (fg.red + bg.red) / 2,
- (fg.green + bg.green) / 2,
- (fg.blue + bg.blue) / 2,
- (fg.alpha + bg.alpha) / 2);
+ cairo_set_source_rgba (cr, 0, 0, 0, 0.4);
cairo_rectangle (cr,
viewport.x, viewport.y,
viewport.width, viewport.height);
-
- cairo_fill_preserve (cr);
-
foo_scroll_area_add_input_from_fill (area, cr, on_canvas_event, NULL);
-
- cairo_set_source_rgba (cr,
- 0.7 * bg.red,
- 0.7 * bg.green,
- 0.7 * bg.blue,
- 0.7 * bg.alpha);
-
- cairo_stroke (cr);
+ cairo_fill (cr);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]