Merge lp:~cimi/notify-osd/color-tweaks into lp:~canonical-dx-team/notify-osd/precise

Proposed by Andrea Cimitan on 2012-04-02
Status: Merged
Approved by: Allan LeSage on 2012-11-26
Approved revision: 458
Merged at revision: 458
Proposed branch: lp:~cimi/notify-osd/color-tweaks
Merge into: lp:~canonical-dx-team/notify-osd/precise
Diff against target: 59 lines (+24/-7)
1 file modified
src/bubble.c (+24/-7)
To merge this branch: bzr merge lp:~cimi/notify-osd/color-tweaks
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing on 2012-11-26
jenkins (community) continuous-integration Approve on 2012-06-25
John Lea (community) design Approve on 2012-04-10
Mirco Müller (community) 2012-04-02 Needs Information on 2012-04-04
Review via email: mp+100406@code.launchpad.net

Description of the change

Add some color tweak capabilities, and slightly start tweaking colors

To post a comment you must log in.
Mirco Müller (macslow) wrote :

What design-guideline (bug) requires this change?

review: Needs Information
Andrea Cimitan (cimi) wrote :

There's no bug, but you got the mail from John Lea. The goal is to make the color more vibrant and darker trying to mimic the overlay blending used in the dash but using over as operator.

Mirco Müller (macslow) wrote :

I would rather review this again, when the BGHash change (from Gord) is available... which is sometime later today then.

Andrea Cimitan (cimi) wrote :

up! :-)

John Lea (johnlea) wrote :

Signed off by design

review: Approve (design)
jenkins (martin-mrazik+qa) wrote :

PASSED: Continuous integration, rev:458
http://s-jenkins:8080/job/notify-osd-ci/2/

review: Approve (continuous-integration)
Didier Roche (didrocks) wrote :

was never approved, approving.

Allan LeSage (allanlesage) wrote :

Apologies on Jenkins' behalf for the mess--the code should land with this new approval. (Was caught expecting inline packaging to land and had to adjust.)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bubble.c'
2--- src/bubble.c 2012-03-09 21:20:47 +0000
3+++ src/bubble.c 2012-04-10 10:47:21 +0000
4@@ -119,6 +119,14 @@
5 A
6 };
7
8+typedef struct _NotifyHSVColor NotifyHSVColor;
9+
10+struct _NotifyHSVColor {
11+ gdouble hue;
12+ gdouble saturation;
13+ gdouble value;
14+};
15+
16 #define TEMPORARY_ICON_PREFIX_WORKAROUND 1
17 #ifdef TEMPORARY_ICON_PREFIX_WORKAROUND
18 #warning "--== Using the icon-name-substitution! This is a temp. workaround not going to be maintained for long! ==--"
19@@ -673,7 +681,16 @@
20 color_string = defaults_get_bubble_bg_color (d);
21 gdk_rgba_parse (&color, color_string);
22 g_free (color_string);
23-
24+
25+ // Apply color tweaks
26+ NotifyHSVColor hsv_color;
27+ gtk_rgb_to_hsv (color.red, color.green, color.blue,
28+ &hsv_color.hue, &hsv_color.saturation, &hsv_color.value);
29+ hsv_color.saturation *= (2.0f - hsv_color.saturation);
30+ hsv_color.value = MIN (hsv_color.value, 0.4f);
31+ gtk_hsv_to_rgb (hsv_color.hue, hsv_color.saturation, hsv_color.value,
32+ &color.red, &color.green, &color.blue);
33+
34 if (priv->composited)
35 {
36 _draw_shadow (
37@@ -695,16 +712,16 @@
38 cairo_fill (cr);
39 cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
40 cairo_set_source_rgba (cr,
41- 0.75 * color.red,
42- 0.75 * color.green,
43- 0.75 * color.blue,
44+ color.red,
45+ color.green,
46+ color.blue,
47 BUBBLE_BG_COLOR_A);
48 }
49 else
50 cairo_set_source_rgb (cr,
51- 0.75 * color.red,
52- 0.75 * color.green,
53- 0.75 * color.blue);
54+ color.red,
55+ color.green,
56+ color.blue);
57
58 draw_round_rect (
59 cr,

Subscribers

People subscribed via source and target branches