Merge lp:~albyrock87/awn/awn-lucido into lp:awn/0.4
- awn-lucido
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~albyrock87/awn/awn-lucido |
Merge into: | lp:awn/0.4 |
Diff against target: |
1219 lines (+397/-427) 9 files modified
awn-settings/awn-settings.ui (+0/-33) awn-settings/awnDefs.py.in (+0/-1) awn-settings/awnSettings.py.in (+0/-4) data/avant-window-navigator.schema-ini.in.in (+0/-6) src/awn-background-lucido.c (+345/-358) src/awn-background.c (+1/-19) src/awn-background.h (+0/-1) src/awn-defines.h (+0/-1) src/awn-separator.c (+51/-4) |
To merge this branch: | bzr merge lp:~albyrock87/awn/awn-lucido |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michal Hruby (community) | Needs Fixing | ||
Review via email: mp+26488@code.launchpad.net |
This proposal has been superseded by a proposal from 2010-06-08.
Commit message
Description of the change
Thank's to mhr3's idea: "use separators tho style Lucido"
The new Lucido style is here!
We get rid of stripe width!
Align controls only align like it should be :)
Stripe-Style added to non-expanded mode too :)
http://
http://
Align: left ->
http://
I need some review on how are managed separators from Lucido bg
- 712. By Alberto <alby@CASA>
-
Ops, removing test code
- 713. By Alberto <alby@CASA>
-
Better hi-light pattern
- 714. By Alberto <alby@CASA>
-
SEP_WIDTH to SEP_SIZE
- 715. By Alberto <alby@CASA>
-
Fix to expanded+align background position
- 716. By Alberto <alby@CASA>
-
Ops, fix mem leak
- 717. By Alberto <alby@CASA>
-
Fix: Refresh bug in expanded+
align+no- expanders - 718. By Alberto <alby@CASA>
-
Test version on separators.
- 719. By Alberto <alby@CASA>
-
ops
- 720. By Alberto <alby@CASA>
-
Fix to a bug when changing corner radius
Michal Hruby (mhr3) wrote : | # |
Oh, and 1477 is unnecessary.
Alberto Aldegheri (albyrock87) wrote : | # |
> Ok, there'll be many points here, but here we go:
>
> 1) Please add curly brackets to all ifs (& elses) per code guidelines (the
> one-liners).
> 2) awn_background_
> AwnBackgroundLu
> strange...
Ok..
> 3) _init_positions - remove 239-240 - it's init, so the assumption that you
> need to free something is wrong (otherwise it's not really init)
> 4) 315: starting a timer in init method is suspicious, ideally it should be
> started only once you know that you need to animate.
You're right..
> 5) 1082: shouldn't the value be 10?
Not in that case: if the first applet is a separator, that separator acts like a "background changer". If you put a separator in first position, the curve starts from bottom, otherwise from top.
> 6) 1224: What's the 10000?
It can be changed to : if (expand) w = -w; it's just for give "expand" a great importance in the "w" calculation.
> 7) I still don't like the "transparent" property, I suggest connecting to
> expose event instead of setting this property, since you mentioned you don't
> want to add panel-style switch in Separator's expose.
I mentioned I do want to add style switches to Separator :)
So.. what to do now?
> 8) Revert 1436 & 1442.
Ok
- 721. By Alberto <alby@alby-laptop>
-
Some fixes and code restyle
Michal Hruby (mhr3) wrote : | # |
> I mentioned I do want to add style switches to Separator :)
> So.. what to do now?
Add panel-style property to Separators and have AppletManager update it.
- 722. By Alberto <alby@CASA>
-
Revert all animation changes for getting back stability. Animation -for now and for me- cant work. Feel free to fork rev 721.
- 723. By Alberto <alby@CASA>
-
Merge with lp:awn
- 724. By Alberto <alby@CASA>
-
Minor code restyling
- 725. By Alberto <alby@CASA>
-
Bug fixes for separators in first position. Restyle of docklet-mode.
- 726. By Alberto <alby@CASA>
-
For simil-3D lovers: Now 3D angle acts on lucido too.
- 727. By Alberto <alby@CASA>
-
Fix to shape mask
- 728. By Alberto <alby@CASA>
-
Bug fixes to an old bug in cairo-utils: rounded_rect. Rect explode if radius is bigger than available space. Consecutive fix to highlights. Simplify and speedup to Edgy code. Bugfix to 3D style, not listening on corner-radius changes. Fix on Lucdio shape mask.
- 729. By Alberto <alby@CASA>
-
3D style rewritten. Now full customizable.
- 730. By Alberto <alby@CASA>
-
I hate when I forget things.
- 731. By Alberto <alby@CASA>
-
Add thickness to 3D style.
- 732. By Alberto <alby@CASA>
-
Better padding
- 733. By Alberto <alby@CASA>
-
Better painting
- 734. By Alberto <alby@CASA>
-
Other drawing adjust for glass looking
- 735. By Alberto <alby@CASA>
-
Cleanups
- 736. By Alberto <alby@CASA>
-
Thickness set to 7px
- 737. By Alberto <alby@CASA>
-
Better drawing. Thinner and more defined border. Improved padding.
- 738. By Alberto <alby@CASA>
-
s(e)(i)x is better :P
- 739. By Alberto <alby@CASA>
-
Thickness in 3D style, replacing floaty offset. Removed Lucido 3D style. Lucido now uses Curves Symmetry too.
- 740. By Alberto <alby@CASA>
-
Animation added to Lucido. There are some minor glitches sometime...
- 741. By Alberto <alby@CASA>
-
A little speedup
- 742. By Alberto <alby@CASA>
-
Shit. I've forgot this.
- 743. By Alberto <alby@CASA>
-
More consistent with other style engines
- 744. By Alberto <alby@CASA>
-
Huge speedup and cleanup. Fixed an old bug. Now listening on applets position change.
- 745. By Alberto <alby@CASA>
-
Too much cleanup. Now works on expanded mode too.
- 746. By Alberto <alby@CASA>
-
Fix to 3D background padding
- 747. By Alberto <alby@CASA>
-
Rewrite of lucido path code. Bugs fixed and curves symmetry fully working.
- 748. By Alberto <alby@CASA>
-
Emit applets refreshed on docklet mode changed too.
- 749. By Alberto <alby@CASA>
-
Good looking start :)
- 750. By Alberto <alby@CASA>
-
Little fixes
- 751. By Alberto <alby@CASA>
-
Merged from lp:awn
- 752. By Alberto <alby@CASA>
-
Get and Set for separator new properties. Added awn_panel_
get_docklet_ mode to panel, removed the similar method in awn-applet-manager, because it returns -wrong- (updated too late) values. - 753. By Alberto <alby@CASA>
-
I made an error while editing awn-panel.c, reverted that error.
- 754. By Alberto <alby@CASA>
-
Reverted changes on debian/changelog
- 755. By Alberto <alby@CASA>
-
Last fix to 3D edges when corner radius > height
- 756. By Alberto <alby@CASA>
-
I had removed too much things :P
- 757. By Alberto <alby@CASA>
-
There was a drawing bug when corner radius = 0, fixed.
- 758. By Alberto <alby@CASA>
-
Merge with lp:awn rev 713
- 759. By Alberto <alby@CASA>
-
Fixed 3065, sorry michal
- 760. By Alberto <alby@CASA>
-
Fixed Edgy. Auto invalidate bg on changed signal.
- 761. By Alberto <alby@CASA>
-
Revert changes to flat
- 762. By Alberto <alby@CASA>
-
Better start animation. Fix to Criticals on lucido start. Pot Updated with make check.
- 763. By Alberto <alby@CASA>
-
Fixes to bug #608927
- 764. By Alberto <alby@CASA>
-
Avoid merge problems with gutted-core-icons branch
- 765. By Alberto <alby@CASA>
-
Patch for bug #608927
- 766. By Alberto <alby@CASA>
-
Remove unused refresh method from awnClass.py. A little fix to a translation string.
Unmerged revisions
Preview Diff
1 | === modified file 'awn-settings/awn-settings.ui' |
2 | --- awn-settings/awn-settings.ui 2010-06-03 23:39:31 +0000 |
3 | +++ awn-settings/awn-settings.ui 2010-06-08 09:35:36 +0000 |
4 | @@ -899,22 +899,6 @@ |
5 | </packing> |
6 | </child> |
7 | <child> |
8 | - <object class="GtkSpinButton" id="theme_stripe_width"> |
9 | - <property name="visible">True</property> |
10 | - <property name="can_focus">True</property> |
11 | - <property name="invisible_char">●</property> |
12 | - <property name="adjustment">adj_stripe_width</property> |
13 | - <property name="digits">2</property> |
14 | - </object> |
15 | - <packing> |
16 | - <property name="left_attach">2</property> |
17 | - <property name="right_attach">3</property> |
18 | - <property name="top_attach">11</property> |
19 | - <property name="bottom_attach">12</property> |
20 | - <property name="x_options"></property> |
21 | - </packing> |
22 | - </child> |
23 | - <child> |
24 | <object class="GtkSpinButton" id="theme_angle"> |
25 | <property name="visible">True</property> |
26 | <property name="can_focus">True</property> |
27 | @@ -972,19 +956,6 @@ |
28 | </packing> |
29 | </child> |
30 | <child> |
31 | - <object class="GtkLabel" id="label_stripe"> |
32 | - <property name="visible">True</property> |
33 | - <property name="xalign">0</property> |
34 | - <property name="xpad">10</property> |
35 | - <property name="label" translatable="yes">Stripe Width</property> |
36 | - </object> |
37 | - <packing> |
38 | - <property name="right_attach">2</property> |
39 | - <property name="top_attach">11</property> |
40 | - <property name="bottom_attach">12</property> |
41 | - </packing> |
42 | - </child> |
43 | - <child> |
44 | <object class="GtkLabel" id="label49"> |
45 | <property name="visible">True</property> |
46 | <property name="xalign">0</property> |
47 | @@ -3439,10 +3410,6 @@ |
48 | <property name="upper">1</property> |
49 | <property name="step_increment">0.01</property> |
50 | </object> |
51 | - <object class="GtkAdjustment" id="adj_stripe_width"> |
52 | - <property name="upper">1</property> |
53 | - <property name="step_increment">0.01</property> |
54 | - </object> |
55 | <object class="GtkAdjustment" id="adj_radius"> |
56 | <property name="upper">100</property> |
57 | <property name="step_increment">1</property> |
58 | |
59 | === modified file 'awn-settings/awnDefs.py.in' |
60 | --- awn-settings/awnDefs.py.in 2010-05-31 17:41:58 +0000 |
61 | +++ awn-settings/awnDefs.py.in 2010-06-08 09:35:36 +0000 |
62 | @@ -86,7 +86,6 @@ |
63 | PANEL_ANGLE = "panel_angle" #float |
64 | CURVINESS = "curviness" #float |
65 | CURVES_SYMMETRY = "curves_symmetry" #float |
66 | -STRIPE_WIDTH = "stripe_width" #float |
67 | FLOATY_OFFSET = "floaty_offset" #int |
68 | TOOLTIP_FONT_NAME = "tooltip_font_name" #string |
69 | TOOLTIP_FONT_COLOR = "tooltip_font_color" #string |
70 | |
71 | === modified file 'awn-settings/awnSettings.py.in' |
72 | --- awn-settings/awnSettings.py.in 2010-05-31 17:41:58 +0000 |
73 | +++ awn-settings/awnSettings.py.in 2010-06-08 09:35:36 +0000 |
74 | @@ -579,7 +579,6 @@ |
75 | |
76 | curviness = gobject.property(type=float, default=1) |
77 | curves_symmetry = gobject.property(type=float, default=0) |
78 | - stripe_width = gobject.property(type=float, default=0) |
79 | floaty_offset = gobject.property(type=int, default=10) |
80 | angle = gobject.property(type=int, default=45) |
81 | radius = gobject.property(type=int, default=10) |
82 | @@ -730,7 +729,6 @@ |
83 | (defs.THEME, defs.PANEL_ANGLE, 'float', sizes), |
84 | (defs.THEME, defs.CURVINESS, 'float', sizes), |
85 | (defs.THEME, defs.CURVES_SYMMETRY, 'float', sizes), |
86 | - (defs.THEME, defs.STRIPE_WIDTH, 'float', sizes), |
87 | (defs.THEME, defs.FLOATY_OFFSET, 'int', sizes), |
88 | (defs.THEME, defs.TOOLTIP_FONT_NAME, 'str', icon), |
89 | (defs.THEME, defs.TOOLTIP_FONT_COLOR, 'str', icon), |
90 | @@ -828,8 +826,6 @@ |
91 | "curviness", "theme_curviness"), |
92 | (self.client, defs.THEME, defs.CURVES_SYMMETRY, |
93 | "curves-symmetry", "theme_symmetry"), |
94 | - (self.client, defs.THEME, defs.STRIPE_WIDTH, |
95 | - "stripe-width", "theme_stripe_width"), |
96 | (self.client, defs.THEME, defs.PANEL_ANGLE, |
97 | "angle", "theme_angle"), |
98 | (self.client, defs.THEME, defs.FLOATY_OFFSET, |
99 | |
100 | === modified file 'data/avant-window-navigator.schema-ini.in.in' |
101 | --- data/avant-window-navigator.schema-ini.in.in 2010-05-31 17:41:58 +0000 |
102 | +++ data/avant-window-navigator.schema-ini.in.in 2010-06-08 09:35:36 +0000 |
103 | @@ -233,12 +233,6 @@ |
104 | _description=The offset of the Floaty background. |
105 | per_instance = false |
106 | |
107 | -[theme/stripe_width] |
108 | -type = float |
109 | -default = 0.0 |
110 | -_description=The width of the stripe in Lucido mode. |
111 | -per_instance = false |
112 | - |
113 | [theme/dialog_gtk_mode] |
114 | type = boolean |
115 | default = true |
116 | |
117 | === modified file 'src/awn-background-lucido.c' |
118 | --- src/awn-background-lucido.c 2010-05-31 22:40:18 +0000 |
119 | +++ src/awn-background-lucido.c 2010-06-08 09:35:36 +0000 |
120 | @@ -17,7 +17,7 @@ |
121 | * |
122 | * Author : Alberto Aldegheri <albyrock87+dev@gmail.com> |
123 | * Thanks to: Matt <sharkbaitbobby@gmail.com> |
124 | - * for the code section to analyze expanders |
125 | + * for the code section to analyze separators |
126 | * |
127 | */ |
128 | |
129 | @@ -41,10 +41,13 @@ |
130 | { |
131 | gint expw; |
132 | gint expn; |
133 | + gint expp; |
134 | }; |
135 | |
136 | #define TRANSFORM_RADIUS(x) sqrt(x/50.)*50. |
137 | |
138 | +#define IS_SPECIAL(x) AWN_IS_SEPARATOR(x) |
139 | + |
140 | static void awn_background_lucido_draw (AwnBackground *bg, |
141 | cairo_t *cr, |
142 | GtkPositionType position, |
143 | @@ -66,12 +69,24 @@ |
144 | awn_background_lucido_get_needs_redraw (AwnBackground *bg, |
145 | GtkPositionType position, |
146 | GdkRectangle *area); |
147 | + |
148 | +static void |
149 | +_set_special_widget_width_and_transparent (AwnBackground *bg, |
150 | + gint width, |
151 | + gboolean transp, |
152 | + gboolean dispose); |
153 | |
154 | static void |
155 | awn_background_lucido_corner_radius_changed (AwnBackground *bg) |
156 | { |
157 | gboolean expand = FALSE; |
158 | g_object_get (bg->panel, "expand", &expand, NULL); |
159 | + |
160 | + _set_special_widget_width_and_transparent ( |
161 | + bg, |
162 | + TRANSFORM_RADIUS (bg->corner_radius), |
163 | + TRUE, |
164 | + FALSE); |
165 | |
166 | if (!expand) |
167 | { |
168 | @@ -100,7 +115,8 @@ |
169 | gpointer monitor = NULL; |
170 | |
171 | g_signal_connect_swapped (bg, "notify::corner-radius", |
172 | - G_CALLBACK (awn_background_lucido_corner_radius_changed), |
173 | + G_CALLBACK ( |
174 | + awn_background_lucido_corner_radius_changed), |
175 | object); |
176 | |
177 | g_return_if_fail (bg->panel); |
178 | @@ -121,6 +137,8 @@ |
179 | static void |
180 | awn_background_lucido_dispose (GObject *object) |
181 | { |
182 | + _set_special_widget_width_and_transparent |
183 | + (AWN_BACKGROUND (object), 10, FALSE, TRUE); |
184 | gpointer monitor = NULL; |
185 | if (AWN_BACKGROUND (object)->panel) |
186 | { |
187 | @@ -211,6 +229,24 @@ |
188 | return gtk_container_get_children (GTK_CONTAINER (manager)); |
189 | } |
190 | |
191 | +static gint |
192 | +_get_applet_manager_size (AwnBackground* bg, GtkPositionType position) |
193 | +{ |
194 | + AwnAppletManager *manager = NULL; |
195 | + g_object_get (bg->panel, "applet-manager", &manager, NULL); |
196 | + |
197 | + switch (position) |
198 | + { |
199 | + case GTK_POS_BOTTOM: |
200 | + case GTK_POS_TOP: |
201 | + return GTK_WIDGET (manager)->allocation.width; |
202 | + break; |
203 | + default: |
204 | + return GTK_WIDGET (manager)->allocation.height; |
205 | + break; |
206 | + } |
207 | +} |
208 | + |
209 | /** |
210 | * _create_path_lucido: |
211 | * @bg: The background pointer |
212 | @@ -219,17 +255,16 @@ |
213 | * @y: The top left coordinate of the "bar rect" - default = 0 |
214 | * @w: The width of the bar |
215 | * @h: The height of the bar |
216 | - * @stripe: The width of the stripe (0.0-1.0). Zero for auto-stripe. |
217 | * @d: The width of each curve in the path |
218 | * @dc: The width of the external curves in non-expanded&auto mode |
219 | - * @symmetry: The symmetry of the stripe when @stripe > 0 |
220 | * @internal: If Zero, creates the path for the stripe |
221 | * @expanded: If Zero, the bar is not expanded |
222 | + * @align: the monitor align |
223 | * |
224 | * This function creates paths on which the bar will be drawn. |
225 | - * In atuo-stripe, it searchs for expanders applet, each expander |
226 | + * In atuo-stripe, it searchs for separators applet, each separator |
227 | * equals to one curve. |
228 | - * If the first widget is an expander, start from bottom-left, |
229 | + * If the first widget is an separator, start from bottom-left, |
230 | * otherwise start from top-left |
231 | */ |
232 | |
233 | @@ -241,316 +276,236 @@ |
234 | gfloat y, |
235 | gfloat w, |
236 | gfloat h, |
237 | - gfloat stripe, |
238 | gfloat d, |
239 | gfloat dc, |
240 | - gfloat symmetry, |
241 | gboolean internal, |
242 | gboolean expanded, |
243 | gfloat align) |
244 | { |
245 | cairo_new_path (cr); |
246 | |
247 | + gfloat curx = x; |
248 | gfloat lx = x; |
249 | gfloat ly = y; |
250 | gfloat y3 = y + h; |
251 | gfloat y2 = y3 - 5; |
252 | - |
253 | - if (stripe > 0) |
254 | - { |
255 | - if (expanded) |
256 | - { |
257 | - stripe = (w * stripe); /* now stripe = non-stripe */ |
258 | - if (internal) |
259 | - { |
260 | - /* Manual-Stripe & Expanded & Internal */ |
261 | - lx = stripe * symmetry; |
262 | - cairo_move_to (cr, lx, ly); |
263 | - _line_from_to (cr, &lx, &ly, lx+d, y2); |
264 | - _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - d, y2); |
265 | - _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry), y); |
266 | - cairo_close_path (cr); |
267 | - } |
268 | - else |
269 | - { |
270 | - /* Manual-Stripe & Expanded & External */ |
271 | - ly = y3; |
272 | - cairo_move_to (cr, lx, ly); |
273 | - _line_from_to (cr, &lx, &ly, lx, y); |
274 | - _line_from_to (cr, &lx, &ly, stripe * symmetry, y); |
275 | - _line_from_to (cr, &lx, &ly, stripe * symmetry + d, y2); |
276 | - _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry) - d, y2); |
277 | - _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry), y); |
278 | - _line_from_to (cr, &lx, &ly, w, y); |
279 | - _line_from_to (cr, &lx, &ly, w, y3); |
280 | - cairo_close_path (cr); |
281 | - } |
282 | - } |
283 | - else |
284 | - { |
285 | - if (stripe == 1.) |
286 | - { |
287 | - _create_path_lucido (bg, position, cr, x, y, w, h, 0., |
288 | - d, dc, 0., internal, expanded, align); |
289 | - return; |
290 | - } |
291 | - stripe = ((w - dc * 2) * stripe); /* now stripe = non-stripe */ |
292 | - if (internal) |
293 | - { |
294 | - /* Manual-Stripe & Not-Expanded & Internal */ |
295 | - lx = stripe * symmetry + dc; |
296 | - cairo_move_to (cr, lx, ly); |
297 | - _line_from_to (cr, &lx, &ly, lx + d, y2); |
298 | - _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc - d, y2); |
299 | - _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc, y); |
300 | - cairo_close_path (cr); |
301 | - } |
302 | - else |
303 | - { |
304 | - /* Manual-Stripe & Not-Expanded & External */ |
305 | - ly = y3; |
306 | - cairo_move_to (cr, lx, ly); |
307 | - _line_from_to (cr, &lx, &ly, lx+dc, y); |
308 | - _line_from_to (cr, &lx, &ly, stripe * symmetry + dc, y); |
309 | - _line_from_to (cr, &lx, &ly, stripe * symmetry + d + dc, y2); |
310 | - _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc - d, y2); |
311 | - _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc, y); |
312 | - _line_from_to (cr, &lx, &ly, w-dc, y); |
313 | - _line_from_to (cr, &lx, &ly, w, y3); |
314 | - cairo_close_path(cr); |
315 | - } |
316 | - } |
317 | - } |
318 | - else |
319 | - { |
320 | - gint exps_found = 0; |
321 | - gfloat curx = x; |
322 | - |
323 | - if (expanded) |
324 | - { |
325 | - if (internal) |
326 | - { |
327 | - /* Auto-Stripe & Expanded & Internal */ |
328 | - GList *widgets = _get_applet_widgets (bg); |
329 | - GList *i = widgets; |
330 | - GtkWidget *widget = NULL; |
331 | - |
332 | - /* analyze first widget*/ |
333 | - if (i) |
334 | - { |
335 | - widget = GTK_WIDGET (i->data); |
336 | - |
337 | - /* if first widget is an expander or align==0 || 1*/ |
338 | - if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) || |
339 | - ( align == 0. || align == 1. ) ) |
340 | - { |
341 | - /* start from bottom */ |
342 | - lx = curx; |
343 | - ly = y; |
344 | - cairo_move_to (cr, lx, ly); |
345 | - _line_from_to (cr, &lx, &ly, lx, y2); |
346 | - ++exps_found; |
347 | - if (align != 0. && align != 1.) |
348 | - i = i->next; |
349 | - } |
350 | - } |
351 | - /* else start from top */ |
352 | - |
353 | - for (; i; i = i->next) |
354 | - { |
355 | - widget = GTK_WIDGET (i->data); |
356 | - |
357 | - if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget)) |
358 | - { |
359 | - /* if not expander continue */ |
360 | - continue; |
361 | - } |
362 | - /* expander found */ |
363 | - switch (position) |
364 | - { |
365 | - case GTK_POS_BOTTOM: |
366 | - case GTK_POS_TOP: |
367 | - curx = widget->allocation.x; |
368 | - if (exps_found % 2 != 0) |
369 | - { |
370 | - curx += widget->allocation.width; |
371 | - } |
372 | - break; |
373 | - default: |
374 | - curx = widget->allocation.y; |
375 | - if ( exps_found % 2 != 0) |
376 | - { |
377 | - curx += widget->allocation.height; |
378 | - } |
379 | - break; |
380 | - } |
381 | - if (curx < 0) |
382 | - { |
383 | - continue; |
384 | - } |
385 | - |
386 | - if (exps_found == 0) |
387 | - { |
388 | - /* this is the first expander */ |
389 | - lx = curx; |
390 | - cairo_move_to (cr, lx, ly); |
391 | - _line_from_to (cr, &lx, &ly, curx + d, y2); |
392 | - } |
393 | - else |
394 | - { |
395 | - if (exps_found % 2 != 0) |
396 | - { |
397 | - /* odd expander - curve at the end of expander */ |
398 | - _line_from_to (cr, &lx, &ly, curx - d, y2); |
399 | - if (i->next == NULL) |
400 | - _line_from_to (cr, &lx, &ly, curx, y2); |
401 | - _line_from_to (cr, &lx, &ly, curx, y); |
402 | - } |
403 | - else |
404 | - { |
405 | - /* even expander - curve at the start of expander */ |
406 | - _line_from_to (cr, &lx, &ly, curx, y); |
407 | - _line_from_to (cr, &lx, &ly, curx + d, y2); |
408 | - /* else the last widget is an expander */ |
409 | - } |
410 | - } |
411 | - |
412 | - ++exps_found; |
413 | - } |
414 | - g_list_free (widgets); |
415 | - |
416 | - _line_from_to (cr, &lx, &ly, w, ly); |
417 | - |
418 | - if (exps_found % 2 != 0) |
419 | - { |
420 | - _line_from_to (cr, &lx, &ly, lx, y); |
421 | - } |
422 | - |
423 | - cairo_close_path (cr); |
424 | - } |
425 | - else |
426 | - { |
427 | - /* Auto-Stripe & Expanded & External */ |
428 | - |
429 | - GList *widgets = _get_applet_widgets (bg); |
430 | - GList *i = widgets; |
431 | - GtkWidget *widget = NULL; |
432 | - |
433 | - /* analyze first widget*/ |
434 | - if (i) |
435 | - { |
436 | - widget = GTK_WIDGET (i->data); |
437 | - |
438 | - ly = y3; |
439 | - cairo_move_to (cr, lx, ly); |
440 | - |
441 | - /* if first widget is an expander or align==0 || 1*/ |
442 | - if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) || |
443 | - ( align == 0. || align == 1. ) ) |
444 | - { |
445 | - /* start from bottom */ |
446 | - _line_from_to (cr, &lx, &ly, lx, y2); |
447 | - ++exps_found; |
448 | - if (align != 0. && align != 1.) |
449 | - i = i->next; |
450 | - } |
451 | - else |
452 | - { |
453 | - /* start from top */ |
454 | - _line_from_to (cr, &lx, &ly, lx, y); |
455 | - } |
456 | - } |
457 | - |
458 | - for (; i; i = i->next) |
459 | - { |
460 | - widget = GTK_WIDGET (i->data); |
461 | - |
462 | - if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget)) |
463 | - { |
464 | - /* if not expander continue */ |
465 | - continue; |
466 | - } |
467 | - /* expander found */ |
468 | - switch (position) |
469 | - { |
470 | - case GTK_POS_BOTTOM: |
471 | - case GTK_POS_TOP: |
472 | - curx = widget->allocation.x; |
473 | - if (exps_found % 2 != 0) |
474 | - { |
475 | - curx += widget->allocation.width; |
476 | - } |
477 | - break; |
478 | - default: |
479 | - curx = widget->allocation.y; |
480 | - if (exps_found % 2 != 0) |
481 | - { |
482 | - curx += widget->allocation.height; |
483 | - } |
484 | - break; |
485 | - } |
486 | - if (curx < 0) |
487 | - { |
488 | - continue; |
489 | - } |
490 | - |
491 | - if (exps_found % 2 != 0) |
492 | - { |
493 | - _line_from_to (cr, &lx, &ly, curx - d, y2); |
494 | - if (i->next != NULL) |
495 | - _line_from_to (cr, &lx, &ly, curx, y); |
496 | - } |
497 | - else |
498 | - { |
499 | - _line_from_to (cr, &lx, &ly, curx, y); |
500 | - _line_from_to (cr, &lx, &ly, curx + d, y2); |
501 | - } |
502 | - ++exps_found; |
503 | - } |
504 | - g_list_free (widgets); |
505 | - |
506 | + gfloat pad_left = 0.; |
507 | + |
508 | + /* Get list of widgets */ |
509 | + GList *widgets = _get_applet_widgets (bg); |
510 | + GList *i = widgets; |
511 | + GtkWidget *widget = NULL; |
512 | + gboolean first_widget_is_special = FALSE; |
513 | + if (i && IS_SPECIAL (i->data)) |
514 | + { |
515 | + first_widget_is_special = TRUE; |
516 | + } |
517 | + |
518 | + /* We start from left */ |
519 | + ly = y3; |
520 | + cairo_move_to (cr, lx, ly); |
521 | + |
522 | + if (expanded) |
523 | + { |
524 | + pad_left = lx + (w - _get_applet_manager_size (bg, position)) * align; |
525 | + if (first_widget_is_special) |
526 | + { |
527 | + /* start from bottom */ |
528 | + if (internal) |
529 | + { |
530 | + cairo_new_path (cr); |
531 | + ly = y; |
532 | + cairo_move_to (cr, lx, ly); |
533 | + } |
534 | + |
535 | + _line_from_to (cr, &lx, &ly, lx, y2); |
536 | + /* jump first special widget */ |
537 | + i = i->next; |
538 | + } |
539 | + else |
540 | + { |
541 | + /* start from top */ |
542 | + if (internal) |
543 | + { |
544 | + cairo_new_path (cr); |
545 | + ly = y; |
546 | + cairo_move_to (cr, lx, ly); |
547 | + } |
548 | + |
549 | + _line_from_to (cr, &lx, &ly, lx, y); |
550 | + } |
551 | + } |
552 | + else |
553 | + { |
554 | + if (align == 0.) |
555 | + { |
556 | + if (first_widget_is_special) |
557 | + { |
558 | + /* start from bottom */ |
559 | + if (internal) |
560 | + { |
561 | + cairo_new_path (cr); |
562 | + ly = y; |
563 | + cairo_move_to (cr, lx, ly); |
564 | + } |
565 | + _line_from_to (cr, &lx, &ly, lx, y2); |
566 | + /* jump first special widget */ |
567 | + i = i->next; |
568 | + } |
569 | + else |
570 | + { |
571 | + if (internal) |
572 | + { |
573 | + cairo_new_path (cr); |
574 | + ly = y; |
575 | + cairo_move_to (cr, lx, ly); |
576 | + } |
577 | + else |
578 | + { |
579 | + /* start from top */ |
580 | + _line_from_to (cr, &lx, &ly, lx, y); |
581 | + } |
582 | + } |
583 | + } |
584 | + else |
585 | + { |
586 | + pad_left = lx + dc; |
587 | + if (first_widget_is_special) |
588 | + { |
589 | + /* start from bottom */ |
590 | + if (internal) |
591 | + { |
592 | + cairo_new_path (cr); |
593 | + lx = lx + dc; |
594 | + ly = y; |
595 | + cairo_move_to (cr, lx, ly); |
596 | + _line_from_to (cr, &lx, &ly, curx, y3); |
597 | + _line_from_to (cr, &lx, &ly, lx + dc, y2); |
598 | + } |
599 | + else |
600 | + { |
601 | + _line_from_to (cr, &lx, &ly, lx + dc, y2); |
602 | + /* jump first special widget */ |
603 | + } |
604 | + i = i->next; |
605 | + } |
606 | + else |
607 | + { |
608 | + /* start from top */ |
609 | + if (internal) |
610 | + { |
611 | + cairo_new_path (cr); |
612 | + ly = y; |
613 | + lx = lx + dc; |
614 | + cairo_move_to (cr, lx, ly); |
615 | + } |
616 | + else |
617 | + { |
618 | + _line_from_to (cr, &lx, &ly, lx + dc, y); |
619 | + } |
620 | + } |
621 | + } |
622 | + } |
623 | + /* "first curve" done. */ |
624 | + /* now we are on y or y2 */ |
625 | + /* start loop on widgets */ |
626 | + curx = lx; |
627 | + for (; i; i = i->next) |
628 | + { |
629 | + widget = GTK_WIDGET (i->data); |
630 | + |
631 | + if (!IS_SPECIAL (widget)) |
632 | + { |
633 | + /* if not special continue */ |
634 | + continue; |
635 | + } |
636 | + /* special found */ |
637 | + switch (position) |
638 | + { |
639 | + case GTK_POS_BOTTOM: |
640 | + case GTK_POS_TOP: |
641 | + curx = widget->allocation.x + pad_left; |
642 | + break; |
643 | + default: |
644 | + curx = widget->allocation.y + pad_left; |
645 | + break; |
646 | + } |
647 | + if ((curx - pad_left) < 0) |
648 | + { |
649 | + continue; |
650 | + } |
651 | + _line_from_to (cr, &lx, &ly, curx, ly); |
652 | + if (ly == y2) |
653 | + { |
654 | + _line_from_to (cr, &lx, &ly, lx + d, y); |
655 | + } |
656 | + else |
657 | + { |
658 | + _line_from_to (cr, &lx, &ly, lx + d, y2); |
659 | + } |
660 | + } |
661 | + g_list_free (widgets); |
662 | + if (expanded) |
663 | + { |
664 | + /* make sure that cairo close path in the right way */ |
665 | + _line_from_to (cr, &lx, &ly, w, ly); |
666 | + if (internal) |
667 | + { |
668 | + _line_from_to (cr, &lx, &ly, lx, y); |
669 | + } |
670 | + else |
671 | + { |
672 | + _line_from_to (cr, &lx, &ly, lx, y3); |
673 | + } |
674 | + } |
675 | + else |
676 | + { |
677 | + if (align == 1.) |
678 | + { |
679 | + if (internal) |
680 | + { |
681 | + if (ly == y2) |
682 | + { |
683 | + _line_from_to (cr, &lx, &ly, w, ly); |
684 | + _line_from_to (cr, &lx, &ly, lx, y); |
685 | + } |
686 | + /* else close path */ |
687 | + } |
688 | + else |
689 | + { |
690 | _line_from_to (cr, &lx, &ly, w, ly); |
691 | _line_from_to (cr, &lx, &ly, lx, y3); |
692 | - |
693 | - cairo_close_path (cr); |
694 | } |
695 | } |
696 | else |
697 | { |
698 | if (internal) |
699 | { |
700 | - /* Auto-Stripe & Not-Expanded & Internal */ |
701 | - /* no-path */ |
702 | - } |
703 | - else |
704 | - { |
705 | - /* Auto-Stripe & Not-Expanded & External */ |
706 | - ly = y3; |
707 | - cairo_move_to (cr, lx, ly); |
708 | - |
709 | - if (align == 0.) |
710 | - _line_from_to (cr, &lx, &ly, lx , y); |
711 | - else |
712 | - _line_from_to (cr, &lx, &ly, lx + dc, y); |
713 | - |
714 | - if (align == 1.) |
715 | - _line_from_to (cr, &lx, &ly, w, y); |
716 | - else |
717 | + if (ly == y2) |
718 | + { |
719 | + _line_from_to (cr, &lx, &ly, w - dc, y2); |
720 | + _line_from_to (cr, &lx, &ly, w, y3); |
721 | _line_from_to (cr, &lx, &ly, w - dc, y); |
722 | - |
723 | + } |
724 | + /* else close path */ |
725 | + } |
726 | + else |
727 | + { |
728 | + _line_from_to (cr, &lx, &ly, w - dc, ly); |
729 | _line_from_to (cr, &lx, &ly, w, y3); |
730 | - cairo_close_path (cr); |
731 | } |
732 | } |
733 | } |
734 | + cairo_close_path (cr); |
735 | + |
736 | } |
737 | |
738 | static void |
739 | draw_top_bottom_background (AwnBackground* bg, |
740 | GtkPositionType position, |
741 | cairo_t* cr, |
742 | - gint width, |
743 | - gint height) |
744 | + gfloat width, |
745 | + gfloat height) |
746 | { |
747 | cairo_pattern_t *pat = NULL; |
748 | cairo_pattern_t *pat_hi = NULL; |
749 | @@ -565,16 +520,9 @@ |
750 | gfloat align = awn_background_get_panel_alignment (AWN_BACKGROUND (bg)); |
751 | |
752 | /* Make sure the bar gets drawn on the 0.5 pixels (for sharp edges) */ |
753 | - switch (position) |
754 | - { |
755 | - case GTK_POS_TOP: |
756 | - case GTK_POS_BOTTOM: |
757 | - cairo_translate (cr, 0., 0.5); |
758 | - break; |
759 | - default: |
760 | - cairo_translate (cr, 0.5, 0.); |
761 | - break; |
762 | - } |
763 | + cairo_translate (cr, 0.5, 0.5); |
764 | + width -= 0.5; |
765 | + height -= 0.5; |
766 | |
767 | if (gtk_widget_is_composited (GTK_WIDGET (bg->panel)) == FALSE) |
768 | { |
769 | @@ -583,12 +531,12 @@ |
770 | |
771 | /* create internal path */ |
772 | _create_path_lucido (bg, position, cr, -1.0, 0., width, height, |
773 | - bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius), |
774 | - TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry, |
775 | + TRANSFORM_RADIUS (bg->corner_radius), |
776 | + TRANSFORM_RADIUS (bg->corner_radius), |
777 | 1, expand, align); |
778 | |
779 | /* Draw internal pattern if needed */ |
780 | - if ((expand || bg->stripe_width != 0.) && bg->enable_pattern && bg->pattern) |
781 | + if (bg->enable_pattern && bg->pattern) |
782 | { |
783 | /* Prepare pattern */ |
784 | pat_hi = cairo_pattern_create_for_surface (bg->pattern); |
785 | @@ -601,6 +549,13 @@ |
786 | cairo_restore (cr); |
787 | cairo_pattern_destroy (pat_hi); |
788 | } |
789 | + /* Prepare the hi-light */ |
790 | + pat_hi = cairo_pattern_create_linear (0, 0, 0, height); |
791 | + awn_cairo_pattern_add_color_stop_color (pat_hi, 0.0, bg->g_histep_1); |
792 | + awn_cairo_pattern_add_color_stop_color (pat_hi, 0.3, bg->g_histep_2); |
793 | + double red, green, blue, alpha; |
794 | + desktop_agnostic_color_get_cairo_color (bg->g_histep_2, &red, &green, &blue, &alpha); |
795 | + cairo_pattern_add_color_stop_rgba (pat_hi, 0.4, red, green, blue, 0.); |
796 | |
797 | /* Prepare the internal background */ |
798 | pat = cairo_pattern_create_linear (0, 0, 0, height); |
799 | @@ -613,36 +568,25 @@ |
800 | cairo_set_source (cr, pat); |
801 | cairo_paint (cr); |
802 | cairo_restore (cr); |
803 | - |
804 | - /* Prepare external background gradient*/ |
805 | - if (expand || bg->stripe_width != 0.) |
806 | - { |
807 | - cairo_pattern_destroy (pat); |
808 | - pat = cairo_pattern_create_linear (0, 0, 0, height); |
809 | - awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->g_step_1); |
810 | - awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->g_step_2); |
811 | - } |
812 | + /* Draw the internal hi-light gradient */ |
813 | + cairo_save (cr); |
814 | + cairo_clip (cr); |
815 | + cairo_set_source (cr, pat_hi); |
816 | + cairo_paint (cr); |
817 | + cairo_restore (cr); |
818 | + |
819 | + /* Prepare external background gradient*/ |
820 | + cairo_pattern_destroy (pat); |
821 | + pat = cairo_pattern_create_linear (0, 0, 0, height); |
822 | + awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->g_step_1); |
823 | + awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->g_step_2); |
824 | + |
825 | |
826 | /* create external path */ |
827 | _create_path_lucido (bg, position, cr, -1.0, 0., width, height, |
828 | - bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius), |
829 | - TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry, |
830 | + TRANSFORM_RADIUS (bg->corner_radius), |
831 | + TRANSFORM_RADIUS (bg->corner_radius), |
832 | 0, expand, align); |
833 | - |
834 | - /* Draw external pattern if needed */ |
835 | - if (!expand && bg->stripe_width == 0. && bg->enable_pattern && bg->pattern) |
836 | - { |
837 | - /* Prepare pattern */ |
838 | - pat_hi = cairo_pattern_create_for_surface (bg->pattern); |
839 | - cairo_pattern_set_extend (pat_hi, CAIRO_EXTEND_REPEAT); |
840 | - /* Draw */ |
841 | - cairo_save (cr); |
842 | - cairo_clip_preserve (cr); |
843 | - cairo_set_source (cr, pat_hi); |
844 | - cairo_paint (cr); |
845 | - cairo_restore (cr); |
846 | - cairo_pattern_destroy (pat_hi); |
847 | - } |
848 | |
849 | /* Draw the external background */ |
850 | cairo_save (cr); |
851 | @@ -652,19 +596,13 @@ |
852 | cairo_restore (cr); |
853 | cairo_pattern_destroy (pat); |
854 | |
855 | - /* Draw the hi-light */ |
856 | - pat_hi = cairo_pattern_create_linear (0, 0, 0, (height / 3.0)); |
857 | - awn_cairo_pattern_add_color_stop_color (pat_hi, 0.0, bg->g_histep_1); |
858 | - awn_cairo_pattern_add_color_stop_color (pat_hi, 1.0, bg->g_histep_2); |
859 | - |
860 | - if (expand) |
861 | - { |
862 | - cairo_new_path (cr); |
863 | - cairo_rectangle (cr, 0, 0, width, (height / 3.0)); |
864 | - } |
865 | - |
866 | + /* Draw the internal hi-light gradient */ |
867 | + cairo_save (cr); |
868 | + cairo_clip (cr); |
869 | cairo_set_source (cr, pat_hi); |
870 | - cairo_fill (cr); |
871 | + cairo_paint (cr); |
872 | + cairo_restore (cr); |
873 | + |
874 | cairo_pattern_destroy (pat_hi); |
875 | |
876 | return; |
877 | @@ -686,14 +624,14 @@ |
878 | { |
879 | awn_cairo_set_source_color (cr, bg->border_color); |
880 | _create_path_lucido (bg, position, cr, 0., 0., width, height, |
881 | - bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius), |
882 | - TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry, |
883 | + TRANSFORM_RADIUS (bg->corner_radius), |
884 | + TRANSFORM_RADIUS (bg->corner_radius), |
885 | 0, expand, align); |
886 | cairo_stroke (cr); |
887 | awn_cairo_set_source_color (cr, bg->hilight_color); |
888 | _create_path_lucido (bg, position, cr, 1., 1., width-1., height-1., |
889 | - bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius), |
890 | - TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry, |
891 | + TRANSFORM_RADIUS (bg->corner_radius), |
892 | + TRANSFORM_RADIUS (bg->corner_radius), |
893 | 0, expand, align); |
894 | } |
895 | cairo_stroke (cr); |
896 | @@ -800,6 +738,39 @@ |
897 | cairo_restore (cr); |
898 | } |
899 | |
900 | +static void |
901 | +_set_special_widget_width_and_transparent (AwnBackground *bg, |
902 | + gint width, |
903 | + gboolean transp, |
904 | + gboolean dispose) |
905 | +{ |
906 | + GList *widgets = _get_applet_widgets (bg); |
907 | + GList *i = widgets; |
908 | + GtkWidget *widget = NULL; |
909 | + |
910 | + if (i && IS_SPECIAL (i->data) && !dispose) |
911 | + { |
912 | + widget = GTK_WIDGET (i->data); |
913 | + g_object_set (G_OBJECT (widget), "separator-size", 0, NULL); |
914 | + g_object_set (G_OBJECT (widget), "transparent", transp, NULL); |
915 | + i = i->next; |
916 | + } |
917 | + |
918 | + for (; i; i = i->next) |
919 | + { |
920 | + widget = GTK_WIDGET (i->data); |
921 | + if (!IS_SPECIAL (widget)) |
922 | + { |
923 | + /* if not special continue */ |
924 | + continue; |
925 | + } |
926 | + g_object_set (G_OBJECT (widget), "separator-size", width, NULL); |
927 | + g_object_set (G_OBJECT (widget), "transparent", transp, NULL); |
928 | + } |
929 | + |
930 | + g_list_free (widgets); |
931 | +} |
932 | + |
933 | static gboolean |
934 | awn_background_lucido_get_needs_redraw (AwnBackground *bg, |
935 | GtkPositionType position, |
936 | @@ -813,45 +784,55 @@ |
937 | return TRUE; |
938 | } |
939 | |
940 | - /* Check expanders positions & sizes changed */ |
941 | + /* Check separators positions & sizes changed */ |
942 | GList *widgets = _get_applet_widgets (bg); |
943 | GList *i = widgets; |
944 | GtkWidget *widget = NULL; |
945 | gint wcheck = 0; |
946 | gint ncheck = 0; |
947 | + gint pcheck = 0; |
948 | |
949 | for (; i; i = i->next) |
950 | { |
951 | widget = GTK_WIDGET (i->data); |
952 | - |
953 | - if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget)) |
954 | + if (!IS_SPECIAL (widget)) |
955 | { |
956 | - /* if not expander continue */ |
957 | + /* if not special continue */ |
958 | continue; |
959 | } |
960 | - switch (position) |
961 | - { |
962 | - case GTK_POS_BOTTOM: |
963 | - case GTK_POS_TOP: |
964 | - wcheck += (widget->allocation.x * 3) / 2 + widget->allocation.width; |
965 | - break; |
966 | - default: |
967 | - wcheck += (widget->allocation.y * 3 ) / 2 + widget->allocation.height; |
968 | - break; |
969 | - } |
970 | ++ncheck; |
971 | + pcheck += ncheck; |
972 | + switch (position) |
973 | + { |
974 | + case GTK_POS_BOTTOM: |
975 | + case GTK_POS_TOP: |
976 | + wcheck += (widget->allocation.x * ncheck); |
977 | + break; |
978 | + default: |
979 | + wcheck += (widget->allocation.y * ncheck); |
980 | + break; |
981 | + } |
982 | } |
983 | g_list_free (widgets); |
984 | |
985 | + pcheck += _get_applet_manager_size (bg, position); |
986 | + |
987 | AwnBackgroundLucido *lbg = NULL; |
988 | lbg = AWN_BACKGROUND_LUCIDO (bg); |
989 | AwnBackgroundLucidoPrivate *priv; |
990 | priv = AWN_BACKGROUND_LUCIDO_GET_PRIVATE (lbg); |
991 | if (priv->expn != ncheck) |
992 | { |
993 | - priv->expn = ncheck; |
994 | + _set_special_widget_width_and_transparent |
995 | + (bg, TRANSFORM_RADIUS (bg->corner_radius), TRUE, FALSE); |
996 | + } |
997 | + |
998 | + if (priv->expp != pcheck) |
999 | + { |
1000 | + priv->expp = pcheck; |
1001 | /* used to refresh bar */ |
1002 | - awn_background_emit_padding_changed (bg); |
1003 | + awn_background_emit_changed (bg); |
1004 | + return TRUE; |
1005 | } |
1006 | if (priv->expw != wcheck) |
1007 | { |
1008 | @@ -911,9 +892,15 @@ |
1009 | else |
1010 | { |
1011 | _create_path_lucido (bg, position, cr, 0, 0., width, height, |
1012 | - bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius), |
1013 | - TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry, |
1014 | + TRANSFORM_RADIUS (bg->corner_radius), |
1015 | + TRANSFORM_RADIUS (bg->corner_radius), |
1016 | 0, expand, align); |
1017 | + cairo_fill (cr); |
1018 | + _create_path_lucido (bg, position, cr, 0, 0., width, height, |
1019 | + TRANSFORM_RADIUS (bg->corner_radius), |
1020 | + TRANSFORM_RADIUS (bg->corner_radius), |
1021 | + 1, expand, align); |
1022 | + |
1023 | } |
1024 | cairo_fill (cr); |
1025 | |
1026 | |
1027 | === modified file 'src/awn-background.c' |
1028 | --- src/awn-background.c 2010-06-02 09:54:30 +0000 |
1029 | +++ src/awn-background.c 2010-06-08 09:35:36 +0000 |
1030 | @@ -59,8 +59,7 @@ |
1031 | PROP_PANEL_ANGLE, |
1032 | PROP_CURVINESS, |
1033 | PROP_CURVES_SYMEMETRY, |
1034 | - PROP_FLOATY_OFFSET, |
1035 | - PROP_STRIPE_WIDTH |
1036 | + PROP_FLOATY_OFFSET |
1037 | }; |
1038 | |
1039 | enum |
1040 | @@ -197,11 +196,6 @@ |
1041 | object, "curves-symmetry", TRUE, |
1042 | DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, |
1043 | NULL); |
1044 | - desktop_agnostic_config_client_bind (bg->client, |
1045 | - AWN_GROUP_THEME, AWN_THEME_STRIPE_WIDTH, |
1046 | - object, "stripe-width", TRUE, |
1047 | - DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK, |
1048 | - NULL); |
1049 | } |
1050 | |
1051 | static void |
1052 | @@ -367,9 +361,6 @@ |
1053 | case PROP_FLOATY_OFFSET: |
1054 | bg->floaty_offset = g_value_get_int (value); |
1055 | break; |
1056 | - case PROP_STRIPE_WIDTH: |
1057 | - bg->stripe_width = g_value_get_float (value); |
1058 | - break; |
1059 | |
1060 | default: |
1061 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
1062 | @@ -620,15 +611,6 @@ |
1063 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | |
1064 | G_PARAM_STATIC_STRINGS)); |
1065 | |
1066 | - g_object_class_install_property (obj_class, |
1067 | - PROP_STRIPE_WIDTH, |
1068 | - g_param_spec_float ("stripe-width", |
1069 | - "Stripe Width", |
1070 | - "The width of the stripe", |
1071 | - 0.0, 1.0, 0.0, |
1072 | - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | |
1073 | - G_PARAM_STATIC_STRINGS)); |
1074 | - |
1075 | /* Add signals to the class */ |
1076 | _bg_signals[CHANGED] = |
1077 | g_signal_new ("changed", |
1078 | |
1079 | === modified file 'src/awn-background.h' |
1080 | --- src/awn-background.h 2010-05-31 17:41:58 +0000 |
1081 | +++ src/awn-background.h 2010-06-08 09:35:36 +0000 |
1082 | @@ -99,7 +99,6 @@ |
1083 | gint floaty_offset; |
1084 | gfloat curviness; |
1085 | gfloat curves_symmetry; |
1086 | - gfloat stripe_width; |
1087 | |
1088 | /* private */ |
1089 | guint changed; |
1090 | |
1091 | === modified file 'src/awn-defines.h' |
1092 | --- src/awn-defines.h 2010-05-31 17:41:58 +0000 |
1093 | +++ src/awn-defines.h 2010-06-08 09:35:36 +0000 |
1094 | @@ -88,7 +88,6 @@ |
1095 | #define AWN_THEME_CURVINESS "curviness" |
1096 | #define AWN_THEME_CURVES_SYMMETRY "curves_symmetry" |
1097 | #define AWN_THEME_FLOATY_OFFSET "floaty_offset" |
1098 | -#define AWN_THEME_STRIPE_WIDTH "stripe_width" |
1099 | |
1100 | #endif /*_HAVE_AWN_DEFINES_H */ |
1101 | |
1102 | |
1103 | === modified file 'src/awn-separator.c' |
1104 | --- src/awn-separator.c 2010-01-01 21:35:47 +0000 |
1105 | +++ src/awn-separator.c 2010-06-08 09:35:36 +0000 |
1106 | @@ -34,7 +34,9 @@ |
1107 | GtkPositionType position; |
1108 | gint offset; |
1109 | gint size; |
1110 | + gint separator_size; |
1111 | |
1112 | + gboolean transparent; |
1113 | DesktopAgnosticColor *sep_color; |
1114 | }; |
1115 | |
1116 | @@ -47,7 +49,10 @@ |
1117 | PROP_OFFSET, |
1118 | PROP_SIZE, |
1119 | |
1120 | - PROP_SEP_COLOR |
1121 | + PROP_SEP_COLOR, |
1122 | + PROP_SEP_TRANSPARENT, |
1123 | + |
1124 | + PROP_SEP_SIZE |
1125 | }; |
1126 | |
1127 | static void |
1128 | @@ -78,6 +83,12 @@ |
1129 | case PROP_SEP_COLOR: |
1130 | g_value_set_object (value, priv->sep_color); |
1131 | break; |
1132 | + case PROP_SEP_SIZE: |
1133 | + g_value_set_int (value, priv->separator_size); |
1134 | + break; |
1135 | + case PROP_SEP_TRANSPARENT: |
1136 | + g_value_set_boolean (value, priv->transparent); |
1137 | + break; |
1138 | default: |
1139 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
1140 | } |
1141 | @@ -126,6 +137,18 @@ |
1142 | priv->sep_color = g_value_dup_object (value); |
1143 | gtk_widget_queue_draw (GTK_WIDGET (object)); |
1144 | break; |
1145 | + case PROP_SEP_SIZE: |
1146 | + temp = g_value_get_int (value); |
1147 | + if (temp == priv->separator_size) break; |
1148 | + priv->separator_size = temp; |
1149 | + gtk_widget_queue_resize (GTK_WIDGET (object)); |
1150 | + break; |
1151 | + case PROP_SEP_TRANSPARENT: |
1152 | + temp = g_value_get_boolean (value); |
1153 | + if (temp == priv->transparent) break; |
1154 | + priv->transparent = temp; |
1155 | + gtk_widget_queue_draw (GTK_WIDGET (object)); |
1156 | + break; |
1157 | default: |
1158 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
1159 | } |
1160 | @@ -181,13 +204,13 @@ |
1161 | { |
1162 | case GTK_POS_TOP: |
1163 | case GTK_POS_BOTTOM: |
1164 | - req->width = 10; |
1165 | + req->width = priv->separator_size; |
1166 | req->height = priv->size + priv->offset; |
1167 | break; |
1168 | case GTK_POS_LEFT: |
1169 | case GTK_POS_RIGHT: |
1170 | req->width = priv->size + priv->offset; |
1171 | - req->height = 10; |
1172 | + req->height = priv->separator_size; |
1173 | break; |
1174 | default: |
1175 | break; |
1176 | @@ -198,12 +221,18 @@ |
1177 | awn_separator_expose (GtkWidget *widget, GdkEventExpose *event) |
1178 | { |
1179 | AwnSeparatorPrivate *priv = AWN_SEPARATOR (widget)->priv; |
1180 | + |
1181 | + if (priv->transparent) |
1182 | + { |
1183 | + return TRUE; |
1184 | + } |
1185 | + |
1186 | cairo_t *cr; |
1187 | cairo_path_t *path; |
1188 | GtkOrientation orient; |
1189 | cairo_pattern_t *pat = NULL, *shadow_pat = NULL; |
1190 | gdouble r, g, b, a; |
1191 | - |
1192 | + |
1193 | cr = gdk_cairo_create (widget->window); |
1194 | g_return_val_if_fail (cr, FALSE); |
1195 | |
1196 | @@ -366,6 +395,24 @@ |
1197 | DESKTOP_AGNOSTIC_TYPE_COLOR, |
1198 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
1199 | |
1200 | + g_object_class_install_property (object_class, |
1201 | + PROP_SEP_SIZE, |
1202 | + g_param_spec_int ("separator-size", |
1203 | + "Separator Size", |
1204 | + "The size of the separator", |
1205 | + 0, G_MAXINT, 10, |
1206 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | |
1207 | + G_PARAM_STATIC_STRINGS)); |
1208 | + |
1209 | + g_object_class_install_property (object_class, |
1210 | + PROP_SEP_TRANSPARENT, |
1211 | + g_param_spec_boolean ("transparent", |
1212 | + "Transparent", |
1213 | + "Is separator transparent?", |
1214 | + FALSE, |
1215 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | |
1216 | + G_PARAM_STATIC_STRINGS)); |
1217 | + |
1218 | g_type_class_add_private (klass, sizeof (AwnSeparatorPrivate)); |
1219 | } |
1220 |
Ok, there'll be many points here, but here we go:
1) Please add curly brackets to all ifs (& elses) per code guidelines (the one-liners). lucido_ redraw - please add variables for AwnBackgroundLu cidoPrivate and AwnBackground, everything caps looks just strange...
2) awn_background_
3) _init_positions - remove 239-240 - it's init, so the assumption that you need to free something is wrong (otherwise it's not really init)
4) 315: starting a timer in init method is suspicious, ideally it should be started only once you know that you need to animate.
5) 1082: shouldn't the value be 10?
6) 1224: What's the 10000?
7) I still don't like the "transparent" property, I suggest connecting to expose event instead of setting this property, since you mentioned you don't want to add panel-style switch in Separator's expose.
8) Revert 1436 & 1442.