[gnome-control-center] display: indicate the selected display using an outside stroke
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] display: indicate the selected display using an outside stroke
- Date: Sun, 14 Nov 2010 20:45:23 +0000 (UTC)
commit ebf1ced0aeb9e1f8038443a9eee5f3a73fb59b1b
Author: William Jon McCann <jmccann redhat com>
Date: Sun Nov 14 14:56:07 2010 -0500
display: indicate the selected display using an outside stroke
And use the selection color from the widget style. This helps
uncrowd the inner part of the box and will allow more room to
fit a primary display selector.
panels/display/xrandr-capplet.c | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/panels/display/xrandr-capplet.c b/panels/display/xrandr-capplet.c
index 1b4f21c..f2b466b 100644
--- a/panels/display/xrandr-capplet.c
+++ b/panels/display/xrandr-capplet.c
@@ -1725,6 +1725,26 @@ paint_output (App *app, cairo_t *cr, int i)
- x - (w * scale + 0.5) / 2,
- y - (h * scale + 0.5) / 2);
+
+ if (output == app->current_output)
+ {
+ GtkStyle *style;
+ GdkColor color;
+ double r, g, b;
+
+ style = gtk_widget_get_style (app->area);
+ color = style->bg[GTK_STATE_SELECTED];
+ r = (float)color.red / 65535.0;
+ g = (float)color.green / 65535.0;
+ b = (float)color.blue / 65535.0;
+
+ cairo_rectangle (cr, x - 2, y - 2, w * scale + 0.5 + 4, h * scale + 0.5 + 4);
+
+ cairo_set_line_width (cr, 4);
+ cairo_set_source_rgba (cr, r, g, b, 0.5);
+ cairo_stroke (cr);
+ }
+
cairo_rectangle (cr, x, y, w * scale + 0.5, h * scale + 0.5);
cairo_clip_preserve (cr);
@@ -1747,15 +1767,6 @@ paint_output (App *app, cairo_t *cr, int i)
cr, on_output_event, output);
cairo_fill (cr);
- if (output == app->current_output)
- {
- cairo_rectangle (cr, x + 2, y + 2, w * scale + 0.5 - 4, h * scale + 0.5 - 4);
-
- cairo_set_line_width (cr, 4);
- cairo_set_source_rgba (cr, 0.33, 0.43, 0.57, 1.0);
- cairo_stroke (cr);
- }
-
cairo_rectangle (cr, x + 0.5, y + 0.5, w * scale + 0.5 - 1, h * scale + 0.5 - 1);
cairo_set_line_width (cr, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]