Merge lp:~seb128/gnome-control-center-unity/swap-color-use-gdkcolor into lp:gnome-control-center-unity

Proposed by Sebastien Bacher
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 31
Merged at revision: 31
Proposed branch: lp:~seb128/gnome-control-center-unity/swap-color-use-gdkcolor
Merge into: lp:gnome-control-center-unity
Diff against target: 55 lines (+14/-14)
1 file modified
appearance/cc-appearance-panel.c (+14/-14)
To merge this branch: bzr merge lp:~seb128/gnome-control-center-unity/swap-color-use-gdkcolor
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Michael Terry Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+189309@code.launchpad.net

Commit message

Use GdkColor types, for color swapping, since that's what
libgnome-desktop uses. That's a fix similar to the one done previous to
the color selection code.

Description of the change

Use GdkColor types, for color swapping, since that's what
libgnome-desktop uses. That's a fix similar to the one done previous to
the color selection code.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

That's similar to https://code.launchpad.net/~seb128/gnome-control-center-unity/use-correct-color/+merge/168800 which was fixed earlier in the cycle, the color swapping code had the same issue

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Makes sense.

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Works like a charm.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'appearance/cc-appearance-panel.c'
2--- appearance/cc-appearance-panel.c 2013-06-11 19:57:58 +0000
3+++ appearance/cc-appearance-panel.c 2013-10-04 13:30:22 +0000
4@@ -411,7 +411,7 @@
5
6 if (priv->current_background)
7 {
8- GdkRGBA pcolor, scolor;
9+ GdkColor pcolor, scolor;
10 const char* bgsize = NULL;
11
12 markup = g_strdup_printf ("<i>%s</i>", cc_appearance_item_get_name (priv->current_background));
13@@ -428,11 +428,11 @@
14 else
15 gtk_label_set_text (GTK_LABEL (WID ("size_label")), "");
16
17- gdk_rgba_parse (&pcolor, cc_appearance_item_get_pcolor (priv->current_background));
18- gdk_rgba_parse (&scolor, cc_appearance_item_get_scolor (priv->current_background));
19+ gdk_color_parse (cc_appearance_item_get_pcolor (priv->current_background), &pcolor);
20+ gdk_color_parse (cc_appearance_item_get_scolor (priv->current_background), &scolor);
21
22- gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (WID ("style-pcolor")), &pcolor);
23- gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (WID ("style-scolor")), &scolor);
24+ gtk_color_button_set_color (GTK_COLOR_BUTTON (WID ("style-pcolor")), &pcolor);
25+ gtk_color_button_set_color (GTK_COLOR_BUTTON (WID ("style-scolor")), &scolor);
26
27 select_style (GTK_COMBO_BOX (WID ("style-combobox")),
28 cc_appearance_item_get_placement (priv->current_background));
29@@ -905,17 +905,17 @@
30 CcAppearancePanel *panel)
31 {
32 CcAppearancePanelPrivate *priv = panel->priv;
33- GdkRGBA pcolor, scolor;
34+ GdkColor pcolor, scolor;
35 char *new_pcolor, *new_scolor;
36
37- gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (WID ("style-pcolor")), &pcolor);
38- gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (WID ("style-scolor")), &scolor);
39-
40- gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (WID ("style-scolor")), &pcolor);
41- gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (WID ("style-pcolor")), &scolor);
42-
43- new_pcolor = gdk_rgba_to_string (&scolor);
44- new_scolor = gdk_rgba_to_string (&pcolor);
45+ gtk_color_button_get_color (GTK_COLOR_BUTTON (WID ("style-pcolor")), &pcolor);
46+ gtk_color_button_get_color (GTK_COLOR_BUTTON (WID ("style-scolor")), &scolor);
47+
48+ gtk_color_button_set_color (GTK_COLOR_BUTTON (WID ("style-scolor")), &pcolor);
49+ gtk_color_button_set_color (GTK_COLOR_BUTTON (WID ("style-pcolor")), &scolor);
50+
51+ new_pcolor = gdk_color_to_string (&scolor);
52+ new_scolor = gdk_color_to_string (&pcolor);
53
54 g_object_set (priv->current_background,
55 "primary-color", new_pcolor,

Subscribers

People subscribed via source and target branches

to all changes: