Merge lp:~macslow/unity/unity.fix-863246 into lp:unity
- unity.fix-863246
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Andrea Azzarone |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1832 |
Proposed branch: | lp:~macslow/unity/unity.fix-863246 |
Merge into: | lp:unity |
Diff against target: |
503 lines (+156/-170) 4 files modified
plugins/unityshell/resources/dash-widgets.json (+2/-2) plugins/unityshell/src/DashStyle.cpp (+151/-164) plugins/unityshell/src/DashStyle.h (+1/-2) plugins/unityshell/src/FilterGenreWidget.cpp (+2/-2) |
To merge this branch: | bzr merge lp:~macslow/unity/unity.fix-863246 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Azzarone (community) | Approve | ||
Review via email: mp+88504@code.launchpad.net |
Commit message
Description of the change
Since the bug LP: #863246 states so many issues, I'm splitting up the work into a series of branches/fixes. This first part corrects pixel-grid alignment of selected/unselected button-outlines, opacity-values (outline, filling) and vertical and horizontal spacing between buttons.
Here are a few screenshots/
http://
http://
http://
Unity Merger (unity-merger) wrote : | # |
Attempt to merge into lp:unity failed due to conflicts:
text conflict in plugins/
text conflict in plugins/
Unity Merger (unity-merger) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Andrea Azzarone (azzar1) : | # |
Preview Diff
1 | === modified file 'plugins/unityshell/resources/dash-widgets.json' | |||
2 | --- plugins/unityshell/resources/dash-widgets.json 2012-01-09 10:27:16 +0000 | |||
3 | +++ plugins/unityshell/resources/dash-widgets.json 2012-01-13 15:19:22 +0000 | |||
4 | @@ -40,14 +40,14 @@ | |||
5 | 40 | "icon-gap" : 40}, | 40 | "icon-gap" : 40}, |
6 | 41 | 41 | ||
7 | 42 | "button-label": { | 42 | "button-label": { |
9 | 43 | "border-opacity" : [ 1.0, 0.5, 0.5, 0.5, 0.5], | 43 | "border-opacity" : [ 1.0, 0.15, 0.15, 0.15, 0.15], |
10 | 44 | "border-color" : ["#ffffff", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF"], | 44 | "border-color" : ["#ffffff", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF"], |
11 | 45 | "border-size" : [ 2.0, 1.0, 1.0, 0.5, 0.5], | 45 | "border-size" : [ 2.0, 1.0, 1.0, 0.5, 0.5], |
12 | 46 | "text-size" : 1.0, | 46 | "text-size" : 1.0, |
13 | 47 | "text-color" : ["#ffffff", "#ffffff", "#ffffff", "#ffffff", "#ffffff"], | 47 | "text-color" : ["#ffffff", "#ffffff", "#ffffff", "#ffffff", "#ffffff"], |
14 | 48 | "text-opacity" : [ 1.0, 1.0, 1.0, 1.0, 1.0], | 48 | "text-opacity" : [ 1.0, 1.0, 1.0, 1.0, 1.0], |
15 | 49 | "fill-color" : ["#FFFFFF", "#000000", "#000000", "#000000", "#000000"], | 49 | "fill-color" : ["#FFFFFF", "#000000", "#000000", "#000000", "#000000"], |
17 | 50 | "fill-opacity" : [ 0.25, 0.0, 0.0, 0.0, 0.0], | 50 | "fill-opacity" : [ 0.15, 0.0, 0.0, 0.0, 0.0], |
18 | 51 | "overlay-opacity": [ 0.1, 0.1, 0.1, 0.0, 0.0], | 51 | "overlay-opacity": [ 0.1, 0.1, 0.1, 0.0, 0.0], |
19 | 52 | "overlay-mode" : [ "normal", "normal", "normal", "normal", "normal"], | 52 | "overlay-mode" : [ "normal", "normal", "normal", "normal", "normal"], |
20 | 53 | "blur-size" : [ 1, 1, 1, 0, 0]}, | 53 | "blur-size" : [ 1, 1, 1, 0, 0]}, |
21 | 54 | 54 | ||
22 | === modified file 'plugins/unityshell/src/DashStyle.cpp' | |||
23 | --- plugins/unityshell/src/DashStyle.cpp 2011-10-25 16:32:49 +0000 | |||
24 | +++ plugins/unityshell/src/DashStyle.cpp 2012-01-13 15:19:22 +0000 | |||
25 | @@ -61,21 +61,26 @@ | |||
26 | 61 | ::cairo_set_source_rgba(cr, color.red, color.green, color.blue, color.alpha); | 61 | ::cairo_set_source_rgba(cr, color.red, color.green, color.blue, color.alpha); |
27 | 62 | } | 62 | } |
28 | 63 | 63 | ||
30 | 64 | inline double _align(double val) | 64 | inline double _align(double val, bool odd=true) |
31 | 65 | { | 65 | { |
32 | 66 | double fract = val - (int) val; | 66 | double fract = val - (int) val; |
33 | 67 | 67 | ||
45 | 68 | // for strokes with an odd line-width | 68 | if (odd) |
46 | 69 | if (fract != 0.5f) | 69 | { |
47 | 70 | return (double) ((int) val + 0.5f); | 70 | // for strokes with an odd line-width |
48 | 71 | else | 71 | if (fract != 0.5f) |
49 | 72 | return val; | 72 | return (double) ((int) val + 0.5f); |
50 | 73 | 73 | else | |
51 | 74 | // for strokes with an even line-width | 74 | return val; |
52 | 75 | /*if (fract != 0.0f) | 75 | } |
53 | 76 | return (double) ((int) val); | 76 | else |
54 | 77 | else | 77 | { |
55 | 78 | return val;*/ | 78 | // for strokes with an even line-width |
56 | 79 | if (fract != 0.0f) | ||
57 | 80 | return (double) ((int) val); | ||
58 | 81 | else | ||
59 | 82 | return val; | ||
60 | 83 | } | ||
61 | 79 | } | 84 | } |
62 | 80 | 85 | ||
63 | 81 | class LazyLoadTexture | 86 | class LazyLoadTexture |
64 | @@ -412,108 +417,62 @@ | |||
65 | 412 | double y, | 417 | double y, |
66 | 413 | double cornerRadius, | 418 | double cornerRadius, |
67 | 414 | double width, | 419 | double width, |
70 | 415 | double height, | 420 | double height) |
69 | 416 | bool align) | ||
71 | 417 | { | 421 | { |
72 | 418 | // sanity check | 422 | // sanity check |
73 | 419 | if (cairo_status(cr) != CAIRO_STATUS_SUCCESS && | 423 | if (cairo_status(cr) != CAIRO_STATUS_SUCCESS && |
74 | 420 | cairo_surface_get_type(cairo_get_target(cr)) != CAIRO_SURFACE_TYPE_IMAGE) | 424 | cairo_surface_get_type(cairo_get_target(cr)) != CAIRO_SURFACE_TYPE_IMAGE) |
75 | 421 | return; | 425 | return; |
76 | 422 | 426 | ||
77 | 427 | bool odd = true; | ||
78 | 428 | |||
79 | 429 | odd = cairo_get_line_width (cr) == 2.0 ? false : true; | ||
80 | 430 | |||
81 | 423 | double radius = cornerRadius / aspect; | 431 | double radius = cornerRadius / aspect; |
82 | 424 | 432 | ||
175 | 425 | if (align) | 433 | // top-left, right of the corner |
176 | 426 | { | 434 | cairo_move_to(cr, _align (x + radius, odd), _align (y, odd)); |
177 | 427 | // top-left, right of the corner | 435 | |
178 | 428 | cairo_move_to(cr, _align (x + radius), _align (y)); | 436 | // top-right, left of the corner |
179 | 429 | 437 | cairo_line_to(cr, _align(x + width - radius, odd), _align(y, odd)); | |
180 | 430 | // top-right, left of the corner | 438 | |
181 | 431 | cairo_line_to(cr, _align(x + width - radius), _align(y)); | 439 | // top-right, below the corner |
182 | 432 | 440 | cairo_arc(cr, | |
183 | 433 | // top-right, below the corner | 441 | _align(x + width - radius, odd), |
184 | 434 | cairo_arc(cr, | 442 | _align(y + radius, odd), |
185 | 435 | _align(x + width - radius), | 443 | radius, |
186 | 436 | _align(y + radius), | 444 | -90.0f * G_PI / 180.0f, |
187 | 437 | radius, | 445 | 0.0f * G_PI / 180.0f); |
188 | 438 | -90.0f * G_PI / 180.0f, | 446 | |
189 | 439 | 0.0f * G_PI / 180.0f); | 447 | // bottom-right, above the corner |
190 | 440 | 448 | cairo_line_to(cr, _align(x + width, odd), _align(y + height - radius, odd)); | |
191 | 441 | // bottom-right, above the corner | 449 | |
192 | 442 | cairo_line_to(cr, _align(x + width), _align(y + height - radius)); | 450 | // bottom-right, left of the corner |
193 | 443 | 451 | cairo_arc(cr, | |
194 | 444 | // bottom-right, left of the corner | 452 | _align(x + width - radius, odd), |
195 | 445 | cairo_arc(cr, | 453 | _align(y + height - radius, odd), |
196 | 446 | _align(x + width - radius), | 454 | radius, |
197 | 447 | _align(y + height - radius), | 455 | 0.0f * G_PI / 180.0f, |
198 | 448 | radius, | 456 | 90.0f * G_PI / 180.0f); |
199 | 449 | 0.0f * G_PI / 180.0f, | 457 | |
200 | 450 | 90.0f * G_PI / 180.0f); | 458 | // bottom-left, right of the corner |
201 | 451 | 459 | cairo_line_to(cr, _align(x + radius, odd), _align(y + height, odd)); | |
202 | 452 | // bottom-left, right of the corner | 460 | |
203 | 453 | cairo_line_to(cr, _align(x + radius), _align(y + height)); | 461 | // bottom-left, above the corner |
204 | 454 | 462 | cairo_arc(cr, | |
205 | 455 | // bottom-left, above the corner | 463 | _align(x + radius, odd), |
206 | 456 | cairo_arc(cr, | 464 | _align(y + height - radius, odd), |
207 | 457 | _align(x + radius), | 465 | radius, |
208 | 458 | _align(y + height - radius), | 466 | 90.0f * G_PI / 180.0f, |
209 | 459 | radius, | 467 | 180.0f * G_PI / 180.0f); |
210 | 460 | 90.0f * G_PI / 180.0f, | 468 | |
211 | 461 | 180.0f * G_PI / 180.0f); | 469 | // top-left, right of the corner |
212 | 462 | 470 | cairo_arc(cr, | |
213 | 463 | // top-left, right of the corner | 471 | _align(x + radius, odd), |
214 | 464 | cairo_arc(cr, | 472 | _align(y + radius, odd), |
215 | 465 | _align(x + radius), | 473 | radius, |
216 | 466 | _align(y + radius), | 474 | 180.0f * G_PI / 180.0f, |
217 | 467 | radius, | 475 | 270.0f * G_PI / 180.0f); |
126 | 468 | 180.0f * G_PI / 180.0f, | ||
127 | 469 | 270.0f * G_PI / 180.0f); | ||
128 | 470 | } | ||
129 | 471 | else | ||
130 | 472 | { | ||
131 | 473 | // top-left, right of the corner | ||
132 | 474 | cairo_move_to(cr, x + radius, y); | ||
133 | 475 | |||
134 | 476 | // top-right, left of the corner | ||
135 | 477 | cairo_line_to(cr, x + width - radius, y); | ||
136 | 478 | |||
137 | 479 | // top-right, below the corner | ||
138 | 480 | cairo_arc(cr, | ||
139 | 481 | x + width - radius, | ||
140 | 482 | y + radius, | ||
141 | 483 | radius, | ||
142 | 484 | -90.0f * G_PI / 180.0f, | ||
143 | 485 | 0.0f * G_PI / 180.0f); | ||
144 | 486 | |||
145 | 487 | // bottom-right, above the corner | ||
146 | 488 | cairo_line_to(cr, x + width, y + height - radius); | ||
147 | 489 | |||
148 | 490 | // bottom-right, left of the corner | ||
149 | 491 | cairo_arc(cr, | ||
150 | 492 | x + width - radius, | ||
151 | 493 | y + height - radius, | ||
152 | 494 | radius, | ||
153 | 495 | 0.0f * G_PI / 180.0f, | ||
154 | 496 | 90.0f * G_PI / 180.0f); | ||
155 | 497 | |||
156 | 498 | // bottom-left, right of the corner | ||
157 | 499 | cairo_line_to(cr, x + radius, y + height); | ||
158 | 500 | |||
159 | 501 | // bottom-left, above the corner | ||
160 | 502 | cairo_arc(cr, | ||
161 | 503 | x + radius, | ||
162 | 504 | y + height - radius, | ||
163 | 505 | radius, | ||
164 | 506 | 90.0f * G_PI / 180.0f, | ||
165 | 507 | 180.0f * G_PI / 180.0f); | ||
166 | 508 | |||
167 | 509 | // top-left, right of the corner | ||
168 | 510 | cairo_arc(cr, | ||
169 | 511 | x + radius, | ||
170 | 512 | y + radius, | ||
171 | 513 | radius, | ||
172 | 514 | 180.0f * G_PI / 180.0f, | ||
173 | 515 | 270.0f * G_PI / 180.0f); | ||
174 | 516 | } | ||
218 | 517 | } | 476 | } |
219 | 518 | 477 | ||
220 | 519 | static inline void _blurinner(guchar* pixel, | 478 | static inline void _blurinner(guchar* pixel, |
221 | @@ -1007,48 +966,51 @@ | |||
222 | 1007 | Arrow arrow, | 966 | Arrow arrow, |
223 | 1008 | nux::ButtonVisualState state) | 967 | nux::ButtonVisualState state) |
224 | 1009 | { | 968 | { |
226 | 1010 | double radius = cornerRadius / aspect; | 969 | double radius = cornerRadius / aspect; |
227 | 1011 | double arrow_w = radius / 1.5; | 970 | double arrow_w = radius / 1.5; |
228 | 1012 | double arrow_h = radius / 2.0; | 971 | double arrow_h = radius / 2.0; |
229 | 972 | bool odd = true; | ||
230 | 973 | |||
231 | 974 | odd = cairo_get_line_width (cr) == 2.0 ? false : true; | ||
232 | 1013 | 975 | ||
233 | 1014 | switch (segment) | 976 | switch (segment) |
234 | 1015 | { | 977 | { |
235 | 1016 | case Segment::LEFT: | 978 | case Segment::LEFT: |
236 | 1017 | // top-left, right of the corner | 979 | // top-left, right of the corner |
238 | 1018 | cairo_move_to(cr, x + radius, y); | 980 | cairo_move_to(cr, _align(x + radius, odd), _align(y, odd)); |
239 | 1019 | 981 | ||
240 | 1020 | // top-right | 982 | // top-right |
242 | 1021 | cairo_line_to(cr, x + width, y); | 983 | cairo_line_to(cr, _align(x + width, odd), _align(y, odd)); |
243 | 1022 | 984 | ||
244 | 1023 | if (arrow == Arrow::RIGHT && state == nux::VISUAL_STATE_PRESSED) | 985 | if (arrow == Arrow::RIGHT && state == nux::VISUAL_STATE_PRESSED) |
245 | 1024 | { | 986 | { |
249 | 1025 | cairo_line_to(cr, x + width, y + height / 2.0 - arrow_h); | 987 | cairo_line_to(cr, _align(x + width, odd), _align(y + height / 2.0 - arrow_h, odd)); |
250 | 1026 | cairo_line_to(cr, x + width - arrow_w, y + height / 2.0); | 988 | cairo_line_to(cr, _align(x + width - arrow_w, odd), _align(y + height / 2.0, odd)); |
251 | 1027 | cairo_line_to(cr, x + width, y + height / 2.0 + arrow_h); | 989 | cairo_line_to(cr, _align(x + width, odd), _align(y + height / 2.0 + arrow_h, odd)); |
252 | 1028 | } | 990 | } |
253 | 1029 | 991 | ||
254 | 1030 | // bottom-right | 992 | // bottom-right |
256 | 1031 | cairo_line_to(cr, x + width, y + height); | 993 | cairo_line_to(cr, _align(x + width, odd), _align(y + height, odd)); |
257 | 1032 | 994 | ||
258 | 1033 | // bottom-left, right of the corner | 995 | // bottom-left, right of the corner |
260 | 1034 | cairo_line_to(cr, x + radius, y + height); | 996 | cairo_line_to(cr, _align(x + radius, odd), _align(y + height, odd)); |
261 | 1035 | 997 | ||
262 | 1036 | // bottom-left, above the corner | 998 | // bottom-left, above the corner |
263 | 1037 | cairo_arc(cr, | 999 | cairo_arc(cr, |
267 | 1038 | x + radius, | 1000 | _align(x, odd) + _align(radius, odd), |
268 | 1039 | y + height - radius, | 1001 | _align(y + height, odd) - _align(radius, odd), |
269 | 1040 | radius, | 1002 | _align(radius, odd), |
270 | 1041 | 90.0f * G_PI / 180.0f, | 1003 | 90.0f * G_PI / 180.0f, |
271 | 1042 | 180.0f * G_PI / 180.0f); | 1004 | 180.0f * G_PI / 180.0f); |
272 | 1043 | 1005 | ||
273 | 1044 | // left, right of the corner | 1006 | // left, right of the corner |
275 | 1045 | cairo_line_to(cr, x, y + radius); | 1007 | cairo_line_to(cr, _align(x, odd), _align(y + radius, odd)); |
276 | 1046 | 1008 | ||
277 | 1047 | // top-left, right of the corner | 1009 | // top-left, right of the corner |
278 | 1048 | cairo_arc(cr, | 1010 | cairo_arc(cr, |
282 | 1049 | x + radius, | 1011 | _align(x, odd) + _align(radius, odd), |
283 | 1050 | y + radius, | 1012 | _align(y, odd) + _align(radius, odd), |
284 | 1051 | radius, | 1013 | _align(radius, odd), |
285 | 1052 | 180.0f * G_PI / 180.0f, | 1014 | 180.0f * G_PI / 180.0f, |
286 | 1053 | 270.0f * G_PI / 180.0f); | 1015 | 270.0f * G_PI / 180.0f); |
287 | 1054 | 1016 | ||
288 | @@ -1056,29 +1018,29 @@ | |||
289 | 1056 | 1018 | ||
290 | 1057 | case Segment::MIDDLE: | 1019 | case Segment::MIDDLE: |
291 | 1058 | // top-left | 1020 | // top-left |
293 | 1059 | cairo_move_to(cr, x, y); | 1021 | cairo_move_to(cr, _align(x, odd), _align(y, odd)); |
294 | 1060 | 1022 | ||
295 | 1061 | // top-right | 1023 | // top-right |
297 | 1062 | cairo_line_to(cr, x + width, y); | 1024 | cairo_line_to(cr, _align(x + width, odd), _align(y, odd)); |
298 | 1063 | 1025 | ||
299 | 1064 | if ((arrow == Arrow::RIGHT || arrow == Arrow::BOTH) && state == nux::VISUAL_STATE_PRESSED) | 1026 | if ((arrow == Arrow::RIGHT || arrow == Arrow::BOTH) && state == nux::VISUAL_STATE_PRESSED) |
300 | 1065 | { | 1027 | { |
304 | 1066 | cairo_line_to(cr, x + width, y + height / 2.0 - arrow_h); | 1028 | cairo_line_to(cr, _align(x + width, odd), _align(y + height / 2.0 - arrow_h, odd)); |
305 | 1067 | cairo_line_to(cr, x + width - arrow_w, y + height / 2.0); | 1029 | cairo_line_to(cr, _align(x + width - arrow_w, odd), _align(y + height / 2.0, odd)); |
306 | 1068 | cairo_line_to(cr, x + width, y + height / 2.0 + arrow_h); | 1030 | cairo_line_to(cr, _align(x + width, odd), _align(y + height / 2.0 + arrow_h, odd)); |
307 | 1069 | } | 1031 | } |
308 | 1070 | 1032 | ||
309 | 1071 | // bottom-right | 1033 | // bottom-right |
311 | 1072 | cairo_line_to(cr, x + width, y + height); | 1034 | cairo_line_to(cr, _align(x + width, odd), _align(y + height, odd)); |
312 | 1073 | 1035 | ||
313 | 1074 | // bottom-left | 1036 | // bottom-left |
315 | 1075 | cairo_line_to(cr, x, y + height); | 1037 | cairo_line_to(cr, _align(x, odd), _align(y + height, odd)); |
316 | 1076 | 1038 | ||
317 | 1077 | if ((arrow == Arrow::LEFT || arrow == Arrow::BOTH) && state == nux::VISUAL_STATE_PRESSED) | 1039 | if ((arrow == Arrow::LEFT || arrow == Arrow::BOTH) && state == nux::VISUAL_STATE_PRESSED) |
318 | 1078 | { | 1040 | { |
322 | 1079 | cairo_line_to(cr, x, y + height / 2.0 + arrow_h); | 1041 | cairo_line_to(cr, _align(x, odd), _align(y + height / 2.0 + arrow_h, odd)); |
323 | 1080 | cairo_line_to(cr, x + arrow_w, y + height / 2.0); | 1042 | cairo_line_to(cr, _align(x + arrow_w, odd), _align(y + height / 2.0, odd)); |
324 | 1081 | cairo_line_to(cr, x, y + height / 2.0 - arrow_h); | 1043 | cairo_line_to(cr, _align(x, odd), _align(y + height / 2.0 - arrow_h, odd)); |
325 | 1082 | } | 1044 | } |
326 | 1083 | 1045 | ||
327 | 1084 | // back to top-left | 1046 | // back to top-left |
328 | @@ -1087,38 +1049,38 @@ | |||
329 | 1087 | 1049 | ||
330 | 1088 | case Segment::RIGHT: | 1050 | case Segment::RIGHT: |
331 | 1089 | // top-left, right of the corner | 1051 | // top-left, right of the corner |
333 | 1090 | cairo_move_to(cr, x, y); | 1052 | cairo_move_to(cr, _align(x, odd), _align(y, odd)); |
334 | 1091 | 1053 | ||
335 | 1092 | // top-right, left of the corner | 1054 | // top-right, left of the corner |
337 | 1093 | cairo_line_to(cr, x + width - radius, y); | 1055 | cairo_line_to(cr, _align(x + width - radius, odd), _align(y, odd)); |
338 | 1094 | 1056 | ||
339 | 1095 | // top-right, below the corner | 1057 | // top-right, below the corner |
340 | 1096 | cairo_arc(cr, | 1058 | cairo_arc(cr, |
344 | 1097 | x + width - radius, | 1059 | _align(x + width, odd) - _align(radius, odd), |
345 | 1098 | y + radius, | 1060 | _align(y, odd) + _align(radius, odd), |
346 | 1099 | radius, | 1061 | _align(radius, odd), |
347 | 1100 | -90.0f * G_PI / 180.0f, | 1062 | -90.0f * G_PI / 180.0f, |
348 | 1101 | 0.0f * G_PI / 180.0f); | 1063 | 0.0f * G_PI / 180.0f); |
349 | 1102 | 1064 | ||
350 | 1103 | // bottom-right, above the corner | 1065 | // bottom-right, above the corner |
352 | 1104 | cairo_line_to(cr, x + width, y + height - radius); | 1066 | cairo_line_to(cr, _align(x + width, odd), _align(y + height - radius, odd)); |
353 | 1105 | 1067 | ||
354 | 1106 | // bottom-right, left of the corner | 1068 | // bottom-right, left of the corner |
355 | 1107 | cairo_arc(cr, | 1069 | cairo_arc(cr, |
359 | 1108 | x + width - radius, | 1070 | _align(x + width, odd) - _align(radius, odd), |
360 | 1109 | y + height - radius, | 1071 | _align(y + height, odd) - _align(radius, odd), |
361 | 1110 | radius, | 1072 | _align(radius, odd), |
362 | 1111 | 0.0f * G_PI / 180.0f, | 1073 | 0.0f * G_PI / 180.0f, |
363 | 1112 | 90.0f * G_PI / 180.0f); | 1074 | 90.0f * G_PI / 180.0f); |
364 | 1113 | 1075 | ||
365 | 1114 | // bottom-left | 1076 | // bottom-left |
367 | 1115 | cairo_line_to(cr, x, y + height); | 1077 | cairo_line_to(cr, _align(x, odd), _align(y + height, odd)); |
368 | 1116 | 1078 | ||
369 | 1117 | if (arrow == Arrow::LEFT && state == nux::VISUAL_STATE_PRESSED) | 1079 | if (arrow == Arrow::LEFT && state == nux::VISUAL_STATE_PRESSED) |
370 | 1118 | { | 1080 | { |
374 | 1119 | cairo_line_to(cr, x, y + height / 2.0 + arrow_h); | 1081 | cairo_line_to(cr, _align(x, odd), _align(y + height / 2.0 + arrow_h, odd)); |
375 | 1120 | cairo_line_to(cr, x + arrow_w, y + height / 2.0); | 1082 | cairo_line_to(cr, _align(x + arrow_w, odd), _align(y + height / 2.0, odd)); |
376 | 1121 | cairo_line_to(cr, x, y + height / 2.0 - arrow_h); | 1083 | cairo_line_to(cr, _align(x, odd), _align(y + height / 2.0 - arrow_h, odd)); |
377 | 1122 | } | 1084 | } |
378 | 1123 | 1085 | ||
379 | 1124 | // back to top-left | 1086 | // back to top-left |
380 | @@ -1563,14 +1525,26 @@ | |||
381 | 1563 | //ButtonOutlinePath(cr, true); | 1525 | //ButtonOutlinePath(cr, true); |
382 | 1564 | double w = cairo_image_surface_get_width(cairo_get_target(cr)); | 1526 | double w = cairo_image_surface_get_width(cairo_get_target(cr)); |
383 | 1565 | double h = cairo_image_surface_get_height(cairo_get_target(cr)); | 1527 | double h = cairo_image_surface_get_height(cairo_get_target(cr)); |
392 | 1566 | RoundedRect(cr, | 1528 | |
393 | 1567 | 1.0, | 1529 | cairo_set_line_width(cr, pimpl->button_label_border_size_[state]); |
394 | 1568 | (double) (garnish), | 1530 | |
395 | 1569 | (double) (garnish), | 1531 | if (pimpl->button_label_border_size_[state] == 2.0) |
396 | 1570 | 7.0, | 1532 | RoundedRect(cr, |
397 | 1571 | w - (double) (2 * garnish), | 1533 | 1.0, |
398 | 1572 | h - (double) (2 * garnish), | 1534 | (double) (garnish) + 1.0, |
399 | 1573 | true); | 1535 | (double) (garnish) + 1.0, |
400 | 1536 | 7.0, | ||
401 | 1537 | w - (double) (2 * garnish) - 1.0, | ||
402 | 1538 | h - (double) (2 * garnish) - 1.0); | ||
403 | 1539 | else | ||
404 | 1540 | RoundedRect(cr, | ||
405 | 1541 | 1.0, | ||
406 | 1542 | (double) (garnish), | ||
407 | 1543 | (double) (garnish), | ||
408 | 1544 | 7.0, | ||
409 | 1545 | w - (double) (2 * garnish), | ||
410 | 1546 | h - (double) (2 * garnish)); | ||
411 | 1547 | |||
412 | 1574 | 1548 | ||
413 | 1575 | if (pimpl->button_label_fill_color_[state].alpha != 0.0) | 1549 | if (pimpl->button_label_fill_color_[state].alpha != 0.0) |
414 | 1576 | { | 1550 | { |
415 | @@ -1578,7 +1552,7 @@ | |||
416 | 1578 | cairo_fill_preserve(cr); | 1552 | cairo_fill_preserve(cr); |
417 | 1579 | } | 1553 | } |
418 | 1580 | cairo_set_source_rgba(cr, pimpl->button_label_border_color_[state]); | 1554 | cairo_set_source_rgba(cr, pimpl->button_label_border_color_[state]); |
420 | 1581 | cairo_set_line_width(cr, pimpl->button_label_border_size_[state]); | 1555 | //cairo_set_line_width(cr, pimpl->button_label_border_size_[state]); |
421 | 1582 | cairo_stroke(cr); | 1556 | cairo_stroke(cr); |
422 | 1583 | 1557 | ||
423 | 1584 | pimpl->DrawOverlay(cr, | 1558 | pimpl->DrawOverlay(cr, |
424 | @@ -1707,16 +1681,30 @@ | |||
425 | 1707 | w -= 2.0; | 1681 | w -= 2.0; |
426 | 1708 | } | 1682 | } |
427 | 1709 | 1683 | ||
438 | 1710 | pimpl->RoundedRectSegment(cr, | 1684 | cairo_set_line_width(cr, pimpl->button_label_border_size_[state]); |
439 | 1711 | 1.0, | 1685 | |
440 | 1712 | x, | 1686 | if (pimpl->button_label_border_size_[state] == 2.0) |
441 | 1713 | y, | 1687 | pimpl->RoundedRectSegment(cr, |
442 | 1714 | h / 4.0, | 1688 | 1.0, |
443 | 1715 | w, | 1689 | x+1.0, |
444 | 1716 | h, | 1690 | y+1.0, |
445 | 1717 | segment, | 1691 | (h-1.0) / 4.0, |
446 | 1718 | arrow, | 1692 | w-1.0, |
447 | 1719 | state); | 1693 | h-1.0, |
448 | 1694 | segment, | ||
449 | 1695 | arrow, | ||
450 | 1696 | state); | ||
451 | 1697 | else | ||
452 | 1698 | pimpl->RoundedRectSegment(cr, | ||
453 | 1699 | 1.0, | ||
454 | 1700 | x, | ||
455 | 1701 | y, | ||
456 | 1702 | h / 4.0, | ||
457 | 1703 | w, | ||
458 | 1704 | h, | ||
459 | 1705 | segment, | ||
460 | 1706 | arrow, | ||
461 | 1707 | state); | ||
462 | 1720 | 1708 | ||
463 | 1721 | if (pimpl->button_label_fill_color_[state].alpha != 0.0) | 1709 | if (pimpl->button_label_fill_color_[state].alpha != 0.0) |
464 | 1722 | { | 1710 | { |
465 | @@ -1724,7 +1712,6 @@ | |||
466 | 1724 | cairo_fill_preserve(cr); | 1712 | cairo_fill_preserve(cr); |
467 | 1725 | } | 1713 | } |
468 | 1726 | cairo_set_source_rgba(cr, pimpl->button_label_border_color_[state]); | 1714 | cairo_set_source_rgba(cr, pimpl->button_label_border_color_[state]); |
469 | 1727 | cairo_set_line_width(cr, pimpl->button_label_border_size_[state]); | ||
470 | 1728 | cairo_stroke(cr); | 1715 | cairo_stroke(cr); |
471 | 1729 | pimpl->Text(cr, | 1716 | pimpl->Text(cr, |
472 | 1730 | pimpl->button_label_text_color_[state], | 1717 | pimpl->button_label_text_color_[state], |
473 | 1731 | 1718 | ||
474 | === modified file 'plugins/unityshell/src/DashStyle.h' | |||
475 | --- plugins/unityshell/src/DashStyle.h 2011-10-25 16:32:49 +0000 | |||
476 | +++ plugins/unityshell/src/DashStyle.h 2012-01-13 15:19:22 +0000 | |||
477 | @@ -125,8 +125,7 @@ | |||
478 | 125 | double y, | 125 | double y, |
479 | 126 | double cornerRadius, | 126 | double cornerRadius, |
480 | 127 | double width, | 127 | double width, |
483 | 128 | double height, | 128 | double height); |
482 | 129 | bool align); | ||
484 | 130 | 129 | ||
485 | 131 | nux::Color const& GetTextColor() const; | 130 | nux::Color const& GetTextColor() const; |
486 | 132 | 131 | ||
487 | 133 | 132 | ||
488 | === modified file 'plugins/unityshell/src/FilterGenreWidget.cpp' | |||
489 | --- plugins/unityshell/src/FilterGenreWidget.cpp 2012-01-11 09:32:22 +0000 | |||
490 | +++ plugins/unityshell/src/FilterGenreWidget.cpp 2012-01-13 15:19:22 +0000 | |||
491 | @@ -46,10 +46,10 @@ | |||
492 | 46 | genre_layout_ = new nux::GridHLayout(NUX_TRACKER_LOCATION); | 46 | genre_layout_ = new nux::GridHLayout(NUX_TRACKER_LOCATION); |
493 | 47 | genre_layout_->ForceChildrenSize(true); | 47 | genre_layout_->ForceChildrenSize(true); |
494 | 48 | genre_layout_->MatchContentSize(true); | 48 | genre_layout_->MatchContentSize(true); |
496 | 49 | genre_layout_->SetSpaceBetweenChildren(10, 12); | 49 | genre_layout_->SetSpaceBetweenChildren (7, 9); |
497 | 50 | genre_layout_->SetTopAndBottomPadding(12); | 50 | genre_layout_->SetTopAndBottomPadding(12); |
498 | 51 | genre_layout_->EnablePartialVisibility(false); | 51 | genre_layout_->EnablePartialVisibility(false); |
500 | 52 | genre_layout_->SetChildrenSize(Style::Instance().GetTileWidth() - 12, 32); | 52 | genre_layout_->SetChildrenSize(Style::Instance().GetTileWidth() - 12, 33); |
501 | 53 | 53 | ||
502 | 54 | SetRightHandView(all_button_); | 54 | SetRightHandView(all_button_); |
503 | 55 | SetContents(genre_layout_); | 55 | SetContents(genre_layout_); |
+1