Merge lp:~larsu/unico/remove-focus-attributes into lp:unico

Proposed by Lars Karlitski
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 151
Merged at revision: 151
Proposed branch: lp:~larsu/unico/remove-focus-attributes
Merge into: lp:unico
Diff against target: 54 lines (+9/-21)
2 files modified
unico/unico-draw.c (+9/-3)
unico/unico-engine.c (+0/-18)
To merge this branch: bzr merge lp:~larsu/unico/remove-focus-attributes
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+200813@code.launchpad.net

Commit message

Use outline attributes for focus to avoid custom attributes

Custom attributes are deprecated, slow, and are causing problems with gtk 3.10. Adwaita is using the same hack for some time now [1]. This patch is a bit more hacky in that it hard codes the a fill color.

[1] https://git.gnome.org/browse/gnome-themes-standard/commit/?id=6e641cf46cc70ce770482b3fc331b1fa3cd7af2b

Description of the change

Use outline attributes for focus to avoid custom attributes

Custom attributes are deprecated, slow, and are causing problems with gtk 3.10. Adwaita is using the same hack for some time now [1]. This patch is a bit more hacky in that it hard codes the a fill color.

[1] https://git.gnome.org/browse/gnome-themes-standard/commit/?id=6e641cf46cc70ce770482b3fc331b1fa3cd7af2b

To post a comment you must log in.
Revision history for this message
Andrea Cimitan (cimi) wrote :

Add a comment on the 0.2...

Revision history for this message
Andrea Cimitan (cimi) wrote :

actually just saw you added it on top :)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'unico/unico-draw.c'
--- unico/unico-draw.c 2012-12-11 14:08:58 +0000
+++ unico/unico-draw.c 2014-01-08 11:59:42 +0000
@@ -183,12 +183,18 @@
183 if (line_width < 1)183 if (line_width < 1)
184 return;184 return;
185185
186 /* Use the outline attributes for the focus properties to avoid using
187 * custom attributes. Outlines don't have a fill, so hardcode the fill
188 * color to be the same color as the border, but with 20% of its alpha.
189 */
186 gtk_theming_engine_get (engine, state,190 gtk_theming_engine_get (engine, state,
187 "-unico-focus-border-color", &border_color,191 "outline-color", &border_color,
188 "-unico-focus-border-radius", &radius,192 "outline-offset", &radius,
189 "-unico-focus-fill-color", &fill_color,
190 NULL);193 NULL);
191194
195 fill_color = gdk_rgba_copy (border_color);
196 fill_color->alpha = border_color->alpha * 0.2;
197
192 x += focus_pad;198 x += focus_pad;
193 y += focus_pad;199 y += focus_pad;
194 width -= focus_pad * 2;200 width -= focus_pad * 2;
195201
=== modified file 'unico/unico-engine.c'
--- unico/unico-engine.c 2012-12-11 14:08:58 +0000
+++ unico/unico-engine.c 2014-01-08 11:59:42 +0000
@@ -116,24 +116,6 @@
116 "Arrow texture",116 "Arrow texture",
117 "Arrow texture",117 "Arrow texture",
118 CAIRO_GOBJECT_TYPE_PATTERN, 0));118 CAIRO_GOBJECT_TYPE_PATTERN, 0));
119
120 gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL,
121 g_param_spec_boxed ("focus-border-color",
122 "Focus border color",
123 "Focus border color",
124 GDK_TYPE_RGBA, 0));
125
126 gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL,
127 g_param_spec_int ("focus-border-radius",
128 "Focus border radius",
129 "Focus border radius",
130 0, G_MAXINT, 0, 0));
131
132 gtk_theming_engine_register_property (UNICO_NAMESPACE, NULL,
133 g_param_spec_boxed ("focus-fill-color",
134 "Focus fill color",
135 "Focus fill color",
136 GDK_TYPE_RGBA, 0));
137}119}
138120
139static void121static void

Subscribers

People subscribed via source and target branches