Merge lp:~cimi/unity/fix-cairo-misalignments into lp:unity

Proposed by Neil J. Patel
Status: Merged
Approved by: Mirco Müller
Approved revision: no longer in the source branch.
Merged at revision: 530
Proposed branch: lp:~cimi/unity/fix-cairo-misalignments
Merge into: lp:unity
Diff against target: 230 lines (+80/-25)
3 files modified
unity-private/places/places-button.vala (+20/-11)
unity-private/places/places-default-renderer.vala (+26/-4)
unity-private/places/places-place-search-sections-bar.vala (+34/-10)
To merge this branch: bzr merge lp:~cimi/unity/fix-cairo-misalignments
Reviewer Review Type Date Requested Status
Mirco Müller (community) Approve
Review via email: mp+35992@code.launchpad.net

Description of the change

Cimi's work

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/places/places-button.vala'
2--- unity-private/places/places-button.vala 2010-09-02 23:52:53 +0000
3+++ unity-private/places/places-button.vala 2010-09-20 09:41:09 +0000
4@@ -136,15 +136,14 @@
5 cr.paint ();
6
7 cr.set_operator (Cairo.Operator.OVER);
8- cr.set_line_width (1.5);
9- cr.translate (0.5, 0.5);
10+ cr.set_line_width (1.0);
11
12 if (state == Ctk.ActorState.STATE_NORMAL)
13 {
14 if (_normal_state == NormalState.UNDERLINE)
15 {
16- cr.move_to (x, height - 1);
17- cr.line_to (x + width, height - 1);
18+ cr.move_to (x + 3, height - 1.5);
19+ cr.line_to (x + width - 4, height - 1.5);
20 cr.set_source_rgba (1.0, 1.0, 1.0, 0.3);
21 cr.stroke ();
22 }
23@@ -153,18 +152,18 @@
24 else if (state == Ctk.ActorState.STATE_PRELIGHT &&
25 _prelight_state == PrelightState.UNDERLINE)
26 {
27- cr.move_to (x, height - 1);
28- cr.line_to (x + width, height - 1);
29+ cr.move_to (x + 3, height - 1.5);
30+ cr.line_to (x + width - 4, height - 1.5);
31 cr.set_source_rgba (1.0, 1.0, 1.0, 0.3);
32 cr.stroke ();
33 return;
34 }
35
36- outline_func (cr, width, height);
37+ outline_func (cr, width+1, height+1);
38
39 if (state == Ctk.ActorState.STATE_NORMAL)
40 {
41- cr.set_source_rgba (1.0, 1.0, 1.0, 0.0);
42+
43 }
44 else if (state == Ctk.ActorState.STATE_PRELIGHT)
45 {
46@@ -173,12 +172,15 @@
47 4, 4);
48 var context = new Cairo.Context (pattern);
49
50+ cr.set_source_rgba (1.0, 1.0, 1.0, 0.1);
51+ cr.fill_preserve ();
52+
53 context.set_operator (Cairo.Operator.CLEAR);
54 context.paint ();
55
56 context.set_line_width (0.2);
57 context.set_operator (Cairo.Operator.OVER);
58- context.set_source_rgba (1.0, 1.0, 1.0, 0.85);
59+ context.set_source_rgba (1.0, 1.0, 1.0, 0.4);
60
61 context.move_to (0, 0);
62 context.line_to (4, 4);
63@@ -188,12 +190,19 @@
64 var pat = new Cairo.Pattern.for_surface (pattern);
65 pat.set_extend (Cairo.Extend.REPEAT);
66 cr.set_source (pat);
67+
68+ cr.fill ();
69 }
70 else
71 {
72- cr.set_source_rgba (1.0, 1.0, 1.0, 1.0);
73+ cr.set_source_rgba (1.0, 1.0, 1.0, 1.0);
74+
75+ cr.fill ();
76 }
77- cr.fill_preserve ();
78+
79+ cr.translate (0.5, 0.5);
80+
81+ outline_func (cr, width, height);
82
83 cr.set_source_rgba (1.0, 1.0, 1.0, 0.5);
84 cr.stroke ();
85
86=== modified file 'unity-private/places/places-default-renderer.vala'
87--- unity-private/places/places-default-renderer.vala 2010-09-14 08:50:05 +0000
88+++ unity-private/places/places-default-renderer.vala 2010-09-20 09:41:09 +0000
89@@ -162,11 +162,14 @@
90 }
91 else if (slider_state == SLIDER_STATE_PRELIGHT)
92 {
93+ cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.1f);
94+ cr.fill_preserve ();
95+
96 cr_stripes.set_operator (Cairo.Operator.CLEAR);
97 cr_stripes.paint ();
98 cr_stripes.scale (1.0f, 1.0f);
99 cr_stripes.set_operator (Cairo.Operator.OVER);
100- cr_stripes.set_source_rgba (1.0f, 1.0f, 1.0f, 0.25f);
101+ cr_stripes.set_source_rgba (1.0f, 1.0f, 1.0f, 0.15f);
102 cr_stripes.rectangle (0.0f, 0.0f, 1.0f, 1.0f);
103 cr_stripes.fill ();
104 cr_stripes.rectangle (1.0f, 1.0f, 1.0f, 1.0f);
105@@ -609,8 +612,7 @@
106 cr.paint ();
107
108 cr.set_operator (Cairo.Operator.OVER);
109- cr.translate (0.5, 0.5);
110- cr.set_line_width (1.5);
111+ cr.set_line_width (1.0);
112
113 var radius = 7;
114 float twidth, theight;
115@@ -641,7 +643,27 @@
116 cr.close_path ();
117
118 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.1f);
119- cr.fill_preserve ();
120+ cr.fill ();
121+
122+ cr.translate (0.5, 0.5);
123+
124+ cr.move_to (x, y + radius);
125+ cr.curve_to (x, y,
126+ x, y,
127+ x + radius, y);
128+ cr.line_to (x + w - radius, y);
129+ cr.curve_to (x + w, y,
130+ x + w, y,
131+ x + w, y + radius);
132+ cr.line_to (x + w, y + h - radius);
133+ cr.curve_to (x + w, y + h,
134+ x + w, y + h,
135+ x + w - radius, y + h);
136+ cr.line_to (x + radius, y + h);
137+ cr.curve_to (x, y + h,
138+ x, y + h,
139+ x, y + h - radius);
140+ cr.close_path ();
141
142 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.5f);
143 cr.stroke ();
144
145=== modified file 'unity-private/places/places-place-search-sections-bar.vala'
146--- unity-private/places/places-place-search-sections-bar.vala 2010-09-18 20:56:21 +0000
147+++ unity-private/places/places-place-search-sections-bar.vala 2010-09-20 09:41:09 +0000
148@@ -522,16 +522,12 @@
149 cr.paint ();
150
151 cr.set_operator (Cairo.Operator.OVER);
152- cr.set_line_width (1.5);
153+ cr.set_line_width (1.0);
154 cr.set_source_rgba (1.0, 1.0, 1.0, 0.0);
155
156- cr.translate (0.5, 0.5);
157-
158 var x = 0;
159 var y = 0;
160- width -= 1;
161- height -= 1;
162- var radius = 10;
163+ var radius = 7;
164
165 if ((get_parent () as PlaceSearchSectionsBar).style == SectionStyle.BUTTONS)
166 {
167@@ -556,6 +552,8 @@
168 if (active || state == Ctk.ActorState.STATE_SELECTED)
169 {
170 cr.set_source_rgba (1.0, 1.0, 1.0, 1.0);
171+
172+ cr.fill ();
173 }
174 else if (state == Ctk.ActorState.STATE_PRELIGHT)
175 {
176@@ -563,7 +561,10 @@
177 Cairo.Content.COLOR_ALPHA,
178 4, 4);
179 var context = new Cairo.Context (pattern);
180-
181+
182+ cr.set_source_rgba (1.0, 1.0, 1.0, 0.1);
183+ cr.fill_preserve ();
184+
185 context.set_operator (Cairo.Operator.CLEAR);
186 context.paint ();
187
188@@ -579,16 +580,39 @@
189 var pat = new Cairo.Pattern.for_surface (pattern);
190 pat.set_extend (Cairo.Extend.REPEAT);
191 cr.set_source (pat);
192+
193+ cr.fill ();
194 }
195 else
196 {
197- cr.set_source_rgba (1.0, 1.0, 1.0, 0.0);
198+
199 }
200
201- cr.fill_preserve ();
202+ cr.translate (0.5, 0.5);
203+
204+ width -= 1;
205+ height -= 1;
206+
207+ cr.move_to (x, y + radius);
208+ cr.curve_to (x, y,
209+ x, y,
210+ x + radius, y);
211+ cr.line_to (width - radius, y);
212+ cr.curve_to (width, y,
213+ width, y,
214+ width, y + radius);
215+ cr.line_to (width, height - radius);
216+ cr.curve_to (width, height,
217+ width, height,
218+ width - radius, height);
219+ cr.line_to (x + radius, height);
220+ cr.curve_to (x, height,
221+ x, height,
222+ x, height - radius);
223+ cr.close_path ();
224
225 cr.set_source_rgba (1.0, 1.0, 1.0,
226- state == Ctk.ActorState.STATE_NORMAL ? 0.0 : 0.5);
227+ !active && state == Ctk.ActorState.STATE_NORMAL ? 0.0 : 0.5);
228 cr.stroke ();
229 }
230 else