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
=== modified file 'unity-private/places/places-button.vala'
--- unity-private/places/places-button.vala 2010-09-02 23:52:53 +0000
+++ unity-private/places/places-button.vala 2010-09-20 09:41:09 +0000
@@ -136,15 +136,14 @@
136 cr.paint ();136 cr.paint ();
137137
138 cr.set_operator (Cairo.Operator.OVER);138 cr.set_operator (Cairo.Operator.OVER);
139 cr.set_line_width (1.5);139 cr.set_line_width (1.0);
140 cr.translate (0.5, 0.5);
141140
142 if (state == Ctk.ActorState.STATE_NORMAL)141 if (state == Ctk.ActorState.STATE_NORMAL)
143 {142 {
144 if (_normal_state == NormalState.UNDERLINE)143 if (_normal_state == NormalState.UNDERLINE)
145 {144 {
146 cr.move_to (x, height - 1);145 cr.move_to (x + 3, height - 1.5);
147 cr.line_to (x + width, height - 1);146 cr.line_to (x + width - 4, height - 1.5);
148 cr.set_source_rgba (1.0, 1.0, 1.0, 0.3);147 cr.set_source_rgba (1.0, 1.0, 1.0, 0.3);
149 cr.stroke ();148 cr.stroke ();
150 }149 }
@@ -153,18 +152,18 @@
153 else if (state == Ctk.ActorState.STATE_PRELIGHT &&152 else if (state == Ctk.ActorState.STATE_PRELIGHT &&
154 _prelight_state == PrelightState.UNDERLINE)153 _prelight_state == PrelightState.UNDERLINE)
155 {154 {
156 cr.move_to (x, height - 1);155 cr.move_to (x + 3, height - 1.5);
157 cr.line_to (x + width, height - 1);156 cr.line_to (x + width - 4, height - 1.5);
158 cr.set_source_rgba (1.0, 1.0, 1.0, 0.3);157 cr.set_source_rgba (1.0, 1.0, 1.0, 0.3);
159 cr.stroke ();158 cr.stroke ();
160 return;159 return;
161 }160 }
162161
163 outline_func (cr, width, height);162 outline_func (cr, width+1, height+1);
164163
165 if (state == Ctk.ActorState.STATE_NORMAL)164 if (state == Ctk.ActorState.STATE_NORMAL)
166 {165 {
167 cr.set_source_rgba (1.0, 1.0, 1.0, 0.0);166
168 }167 }
169 else if (state == Ctk.ActorState.STATE_PRELIGHT)168 else if (state == Ctk.ActorState.STATE_PRELIGHT)
170 {169 {
@@ -173,12 +172,15 @@
173 4, 4);172 4, 4);
174 var context = new Cairo.Context (pattern);173 var context = new Cairo.Context (pattern);
175 174
175 cr.set_source_rgba (1.0, 1.0, 1.0, 0.1);
176 cr.fill_preserve ();
177
176 context.set_operator (Cairo.Operator.CLEAR);178 context.set_operator (Cairo.Operator.CLEAR);
177 context.paint ();179 context.paint ();
178180
179 context.set_line_width (0.2);181 context.set_line_width (0.2);
180 context.set_operator (Cairo.Operator.OVER);182 context.set_operator (Cairo.Operator.OVER);
181 context.set_source_rgba (1.0, 1.0, 1.0, 0.85);183 context.set_source_rgba (1.0, 1.0, 1.0, 0.4);
182184
183 context.move_to (0, 0);185 context.move_to (0, 0);
184 context.line_to (4, 4);186 context.line_to (4, 4);
@@ -188,12 +190,19 @@
188 var pat = new Cairo.Pattern.for_surface (pattern);190 var pat = new Cairo.Pattern.for_surface (pattern);
189 pat.set_extend (Cairo.Extend.REPEAT);191 pat.set_extend (Cairo.Extend.REPEAT);
190 cr.set_source (pat);192 cr.set_source (pat);
193
194 cr.fill ();
191 }195 }
192 else196 else
193 {197 {
194 cr.set_source_rgba (1.0, 1.0, 1.0, 1.0);198 cr.set_source_rgba (1.0, 1.0, 1.0, 1.0);
199
200 cr.fill ();
195 }201 }
196 cr.fill_preserve ();202
203 cr.translate (0.5, 0.5);
204
205 outline_func (cr, width, height);
197206
198 cr.set_source_rgba (1.0, 1.0, 1.0, 0.5);207 cr.set_source_rgba (1.0, 1.0, 1.0, 0.5);
199 cr.stroke ();208 cr.stroke ();
200209
=== modified file 'unity-private/places/places-default-renderer.vala'
--- unity-private/places/places-default-renderer.vala 2010-09-14 08:50:05 +0000
+++ unity-private/places/places-default-renderer.vala 2010-09-20 09:41:09 +0000
@@ -162,11 +162,14 @@
162 }162 }
163 else if (slider_state == SLIDER_STATE_PRELIGHT)163 else if (slider_state == SLIDER_STATE_PRELIGHT)
164 {164 {
165 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.1f);
166 cr.fill_preserve ();
167
165 cr_stripes.set_operator (Cairo.Operator.CLEAR);168 cr_stripes.set_operator (Cairo.Operator.CLEAR);
166 cr_stripes.paint ();169 cr_stripes.paint ();
167 cr_stripes.scale (1.0f, 1.0f);170 cr_stripes.scale (1.0f, 1.0f);
168 cr_stripes.set_operator (Cairo.Operator.OVER);171 cr_stripes.set_operator (Cairo.Operator.OVER);
169 cr_stripes.set_source_rgba (1.0f, 1.0f, 1.0f, 0.25f);172 cr_stripes.set_source_rgba (1.0f, 1.0f, 1.0f, 0.15f);
170 cr_stripes.rectangle (0.0f, 0.0f, 1.0f, 1.0f);173 cr_stripes.rectangle (0.0f, 0.0f, 1.0f, 1.0f);
171 cr_stripes.fill ();174 cr_stripes.fill ();
172 cr_stripes.rectangle (1.0f, 1.0f, 1.0f, 1.0f);175 cr_stripes.rectangle (1.0f, 1.0f, 1.0f, 1.0f);
@@ -609,8 +612,7 @@
609 cr.paint ();612 cr.paint ();
610613
611 cr.set_operator (Cairo.Operator.OVER);614 cr.set_operator (Cairo.Operator.OVER);
612 cr.translate (0.5, 0.5);615 cr.set_line_width (1.0);
613 cr.set_line_width (1.5);
614616
615 var radius = 7;617 var radius = 7;
616 float twidth, theight;618 float twidth, theight;
@@ -641,7 +643,27 @@
641 cr.close_path ();643 cr.close_path ();
642644
643 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.1f);645 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.1f);
644 cr.fill_preserve ();646 cr.fill ();
647
648 cr.translate (0.5, 0.5);
649
650 cr.move_to (x, y + radius);
651 cr.curve_to (x, y,
652 x, y,
653 x + radius, y);
654 cr.line_to (x + w - radius, y);
655 cr.curve_to (x + w, y,
656 x + w, y,
657 x + w, y + radius);
658 cr.line_to (x + w, y + h - radius);
659 cr.curve_to (x + w, y + h,
660 x + w, y + h,
661 x + w - radius, y + h);
662 cr.line_to (x + radius, y + h);
663 cr.curve_to (x, y + h,
664 x, y + h,
665 x, y + h - radius);
666 cr.close_path ();
645667
646 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.5f);668 cr.set_source_rgba (1.0f, 1.0f, 1.0f, 0.5f);
647 cr.stroke ();669 cr.stroke ();
648670
=== modified file 'unity-private/places/places-place-search-sections-bar.vala'
--- unity-private/places/places-place-search-sections-bar.vala 2010-09-18 20:56:21 +0000
+++ unity-private/places/places-place-search-sections-bar.vala 2010-09-20 09:41:09 +0000
@@ -522,16 +522,12 @@
522 cr.paint ();522 cr.paint ();
523523
524 cr.set_operator (Cairo.Operator.OVER);524 cr.set_operator (Cairo.Operator.OVER);
525 cr.set_line_width (1.5);525 cr.set_line_width (1.0);
526 cr.set_source_rgba (1.0, 1.0, 1.0, 0.0);526 cr.set_source_rgba (1.0, 1.0, 1.0, 0.0);
527527
528 cr.translate (0.5, 0.5);
529
530 var x = 0;528 var x = 0;
531 var y = 0;529 var y = 0;
532 width -= 1;530 var radius = 7;
533 height -= 1;
534 var radius = 10;
535531
536 if ((get_parent () as PlaceSearchSectionsBar).style == SectionStyle.BUTTONS)532 if ((get_parent () as PlaceSearchSectionsBar).style == SectionStyle.BUTTONS)
537 {533 {
@@ -556,6 +552,8 @@
556 if (active || state == Ctk.ActorState.STATE_SELECTED)552 if (active || state == Ctk.ActorState.STATE_SELECTED)
557 {553 {
558 cr.set_source_rgba (1.0, 1.0, 1.0, 1.0);554 cr.set_source_rgba (1.0, 1.0, 1.0, 1.0);
555
556 cr.fill ();
559 }557 }
560 else if (state == Ctk.ActorState.STATE_PRELIGHT)558 else if (state == Ctk.ActorState.STATE_PRELIGHT)
561 {559 {
@@ -563,7 +561,10 @@
563 Cairo.Content.COLOR_ALPHA,561 Cairo.Content.COLOR_ALPHA,
564 4, 4);562 4, 4);
565 var context = new Cairo.Context (pattern);563 var context = new Cairo.Context (pattern);
566 564
565 cr.set_source_rgba (1.0, 1.0, 1.0, 0.1);
566 cr.fill_preserve ();
567
567 context.set_operator (Cairo.Operator.CLEAR);568 context.set_operator (Cairo.Operator.CLEAR);
568 context.paint ();569 context.paint ();
569570
@@ -579,16 +580,39 @@
579 var pat = new Cairo.Pattern.for_surface (pattern);580 var pat = new Cairo.Pattern.for_surface (pattern);
580 pat.set_extend (Cairo.Extend.REPEAT);581 pat.set_extend (Cairo.Extend.REPEAT);
581 cr.set_source (pat);582 cr.set_source (pat);
583
584 cr.fill ();
582 }585 }
583 else586 else
584 {587 {
585 cr.set_source_rgba (1.0, 1.0, 1.0, 0.0);588
586 }589 }
587590
588 cr.fill_preserve ();591 cr.translate (0.5, 0.5);
592
593 width -= 1;
594 height -= 1;
595
596 cr.move_to (x, y + radius);
597 cr.curve_to (x, y,
598 x, y,
599 x + radius, y);
600 cr.line_to (width - radius, y);
601 cr.curve_to (width, y,
602 width, y,
603 width, y + radius);
604 cr.line_to (width, height - radius);
605 cr.curve_to (width, height,
606 width, height,
607 width - radius, height);
608 cr.line_to (x + radius, height);
609 cr.curve_to (x, height,
610 x, height,
611 x, height - radius);
612 cr.close_path ();
589613
590 cr.set_source_rgba (1.0, 1.0, 1.0,614 cr.set_source_rgba (1.0, 1.0, 1.0,
591 state == Ctk.ActorState.STATE_NORMAL ? 0.0 : 0.5);615 !active && state == Ctk.ActorState.STATE_NORMAL ? 0.0 : 0.5);
592 cr.stroke (); 616 cr.stroke ();
593 }617 }
594 else618 else