diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2012-03-23 01:17:33 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2012-03-27 21:15:36 +0800 |
commit | 81f4651c54df81345644dd7fb2d88ca7bec8350c (patch) | |
tree | d96c3e8e85efeb42efb111070306d1b25d9d26b3 | |
parent | 8df3bd2167cc3b0944f07c2843cdce26f81eb7ba (diff) | |
download | gsoc2013-empathy-81f4651c54df81345644dd7fb2d88ca7bec8350c.tar gsoc2013-empathy-81f4651c54df81345644dd7fb2d88ca7bec8350c.tar.gz gsoc2013-empathy-81f4651c54df81345644dd7fb2d88ca7bec8350c.tar.bz2 gsoc2013-empathy-81f4651c54df81345644dd7fb2d88ca7bec8350c.tar.lz gsoc2013-empathy-81f4651c54df81345644dd7fb2d88ca7bec8350c.tar.xz gsoc2013-empathy-81f4651c54df81345644dd7fb2d88ca7bec8350c.tar.zst gsoc2013-empathy-81f4651c54df81345644dd7fb2d88ca7bec8350c.zip |
call-window: use colors from the theme for placeholders
Use color shades from the color theme for preview placeholders, instead
of hardcoding black/red.
https://bugzilla.gnome.org/show_bug.cgi?id=672561
-rw-r--r-- | src/empathy-call-window.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index be00f2868..e1668ec03 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -873,27 +873,55 @@ empathy_call_window_move_video_preview (EmpathyCallWindow *self, } static void +_clutter_color_from_rgba (ClutterColor *color, + const GdkRGBA *rgba) +{ + color->red = (guint8) floor (rgba->red * 255); + color->green = (guint8) floor (rgba->green * 255); + color->blue = (guint8) floor (rgba->blue * 255); + color->alpha = (guint8) floor (rgba->alpha * 255); +} + +static void empathy_call_window_highlight_preview_rectangle (EmpathyCallWindow *self, PreviewPosition pos) { ClutterActor *rectangle; + GtkStyleContext *context; + GdkRGBA rgba; + ClutterColor color, highlight; rectangle = empathy_call_window_get_preview_rectangle (self, pos); + context = gtk_widget_get_style_context (GTK_WIDGET (self)); + gtk_style_context_get_color (context, 0, &rgba); + + _clutter_color_from_rgba (&color, &rgba); + clutter_color_shade (&color, 1.4, &highlight); empathy_rounded_rectangle_set_border_width ( EMPATHY_ROUNDED_RECTANGLE (rectangle), 2 * SELF_VIDEO_SECTION_MARGIN); empathy_rounded_rectangle_set_border_color ( - EMPATHY_ROUNDED_RECTANGLE (rectangle), CLUTTER_COLOR_Red); + EMPATHY_ROUNDED_RECTANGLE (rectangle), &highlight); } static void empathy_call_window_darken_preview_rectangle (EmpathyCallWindow *self, ClutterActor *rectangle) { + GtkStyleContext *context; + GdkRGBA rgba; + ClutterColor color, darker; + + context = gtk_widget_get_style_context (GTK_WIDGET (self)); + gtk_style_context_get_background_color (context, 0, &rgba); + + _clutter_color_from_rgba (&color, &rgba); + clutter_color_shade (&color, 0.55, &darker); + empathy_rounded_rectangle_set_border_width ( EMPATHY_ROUNDED_RECTANGLE (rectangle), 1); empathy_rounded_rectangle_set_border_color ( - EMPATHY_ROUNDED_RECTANGLE (rectangle), CLUTTER_COLOR_Black); + EMPATHY_ROUNDED_RECTANGLE (rectangle), &darker); } static void |