Awn

Merge lp:~albyrock87/awn/awn-lucido into lp:awn/0.4

Proposed by Alberto Aldegheri
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
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.

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://i49.tinypic.com/bvlhj.png

http://i48.tinypic.com/2q8vs6g.png

Align: left ->
http://i50.tinypic.com/316vxcn.png

I need some review on how are managed separators from Lucido bg

To post a comment you must log in.
lp:~albyrock87/awn/awn-lucido updated
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

Revision history for this message
Michal Hruby (mhr3) 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_lucido_redraw - please add variables for AwnBackgroundLucidoPrivate and AwnBackground, everything caps looks just strange...
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.

review: Needs Fixing (code-review)
Revision history for this message
Michal Hruby (mhr3) wrote :

Oh, and 1477 is unnecessary.

Revision history for this message
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_lucido_redraw - please add variables for
> AwnBackgroundLucidoPrivate and AwnBackground, everything caps looks just
> 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

lp:~albyrock87/awn/awn-lucido updated
721. By Alberto <alby@alby-laptop>

Some fixes and code restyle

Revision history for this message
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.

review: Needs Fixing
lp:~albyrock87/awn/awn-lucido updated
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'awn-settings/awn-settings.ui'
--- awn-settings/awn-settings.ui 2010-06-03 23:39:31 +0000
+++ awn-settings/awn-settings.ui 2010-06-08 09:35:36 +0000
@@ -899,22 +899,6 @@
899 </packing>899 </packing>
900 </child>900 </child>
901 <child>901 <child>
902 <object class="GtkSpinButton" id="theme_stripe_width">
903 <property name="visible">True</property>
904 <property name="can_focus">True</property>
905 <property name="invisible_char">&#x25CF;</property>
906 <property name="adjustment">adj_stripe_width</property>
907 <property name="digits">2</property>
908 </object>
909 <packing>
910 <property name="left_attach">2</property>
911 <property name="right_attach">3</property>
912 <property name="top_attach">11</property>
913 <property name="bottom_attach">12</property>
914 <property name="x_options"></property>
915 </packing>
916 </child>
917 <child>
918 <object class="GtkSpinButton" id="theme_angle">902 <object class="GtkSpinButton" id="theme_angle">
919 <property name="visible">True</property>903 <property name="visible">True</property>
920 <property name="can_focus">True</property>904 <property name="can_focus">True</property>
@@ -972,19 +956,6 @@
972 </packing>956 </packing>
973 </child>957 </child>
974 <child>958 <child>
975 <object class="GtkLabel" id="label_stripe">
976 <property name="visible">True</property>
977 <property name="xalign">0</property>
978 <property name="xpad">10</property>
979 <property name="label" translatable="yes">Stripe Width</property>
980 </object>
981 <packing>
982 <property name="right_attach">2</property>
983 <property name="top_attach">11</property>
984 <property name="bottom_attach">12</property>
985 </packing>
986 </child>
987 <child>
988 <object class="GtkLabel" id="label49">959 <object class="GtkLabel" id="label49">
989 <property name="visible">True</property>960 <property name="visible">True</property>
990 <property name="xalign">0</property>961 <property name="xalign">0</property>
@@ -3439,10 +3410,6 @@
3439 <property name="upper">1</property>3410 <property name="upper">1</property>
3440 <property name="step_increment">0.01</property>3411 <property name="step_increment">0.01</property>
3441 </object>3412 </object>
3442 <object class="GtkAdjustment" id="adj_stripe_width">
3443 <property name="upper">1</property>
3444 <property name="step_increment">0.01</property>
3445 </object>
3446 <object class="GtkAdjustment" id="adj_radius">3413 <object class="GtkAdjustment" id="adj_radius">
3447 <property name="upper">100</property>3414 <property name="upper">100</property>
3448 <property name="step_increment">1</property>3415 <property name="step_increment">1</property>
34493416
=== modified file 'awn-settings/awnDefs.py.in'
--- awn-settings/awnDefs.py.in 2010-05-31 17:41:58 +0000
+++ awn-settings/awnDefs.py.in 2010-06-08 09:35:36 +0000
@@ -86,7 +86,6 @@
86PANEL_ANGLE = "panel_angle" #float86PANEL_ANGLE = "panel_angle" #float
87CURVINESS = "curviness" #float87CURVINESS = "curviness" #float
88CURVES_SYMMETRY = "curves_symmetry" #float88CURVES_SYMMETRY = "curves_symmetry" #float
89STRIPE_WIDTH = "stripe_width" #float
90FLOATY_OFFSET = "floaty_offset" #int89FLOATY_OFFSET = "floaty_offset" #int
91TOOLTIP_FONT_NAME = "tooltip_font_name" #string90TOOLTIP_FONT_NAME = "tooltip_font_name" #string
92TOOLTIP_FONT_COLOR = "tooltip_font_color" #string91TOOLTIP_FONT_COLOR = "tooltip_font_color" #string
9392
=== modified file 'awn-settings/awnSettings.py.in'
--- awn-settings/awnSettings.py.in 2010-05-31 17:41:58 +0000
+++ awn-settings/awnSettings.py.in 2010-06-08 09:35:36 +0000
@@ -579,7 +579,6 @@
579 579
580 curviness = gobject.property(type=float, default=1)580 curviness = gobject.property(type=float, default=1)
581 curves_symmetry = gobject.property(type=float, default=0)581 curves_symmetry = gobject.property(type=float, default=0)
582 stripe_width = gobject.property(type=float, default=0)
583 floaty_offset = gobject.property(type=int, default=10)582 floaty_offset = gobject.property(type=int, default=10)
584 angle = gobject.property(type=int, default=45)583 angle = gobject.property(type=int, default=45)
585 radius = gobject.property(type=int, default=10)584 radius = gobject.property(type=int, default=10)
@@ -730,7 +729,6 @@
730 (defs.THEME, defs.PANEL_ANGLE, 'float', sizes),729 (defs.THEME, defs.PANEL_ANGLE, 'float', sizes),
731 (defs.THEME, defs.CURVINESS, 'float', sizes),730 (defs.THEME, defs.CURVINESS, 'float', sizes),
732 (defs.THEME, defs.CURVES_SYMMETRY, 'float', sizes),731 (defs.THEME, defs.CURVES_SYMMETRY, 'float', sizes),
733 (defs.THEME, defs.STRIPE_WIDTH, 'float', sizes),
734 (defs.THEME, defs.FLOATY_OFFSET, 'int', sizes),732 (defs.THEME, defs.FLOATY_OFFSET, 'int', sizes),
735 (defs.THEME, defs.TOOLTIP_FONT_NAME, 'str', icon),733 (defs.THEME, defs.TOOLTIP_FONT_NAME, 'str', icon),
736 (defs.THEME, defs.TOOLTIP_FONT_COLOR, 'str', icon),734 (defs.THEME, defs.TOOLTIP_FONT_COLOR, 'str', icon),
@@ -828,8 +826,6 @@
828 "curviness", "theme_curviness"),826 "curviness", "theme_curviness"),
829 (self.client, defs.THEME, defs.CURVES_SYMMETRY,827 (self.client, defs.THEME, defs.CURVES_SYMMETRY,
830 "curves-symmetry", "theme_symmetry"),828 "curves-symmetry", "theme_symmetry"),
831 (self.client, defs.THEME, defs.STRIPE_WIDTH,
832 "stripe-width", "theme_stripe_width"),
833 (self.client, defs.THEME, defs.PANEL_ANGLE,829 (self.client, defs.THEME, defs.PANEL_ANGLE,
834 "angle", "theme_angle"),830 "angle", "theme_angle"),
835 (self.client, defs.THEME, defs.FLOATY_OFFSET,831 (self.client, defs.THEME, defs.FLOATY_OFFSET,
836832
=== modified file 'data/avant-window-navigator.schema-ini.in.in'
--- data/avant-window-navigator.schema-ini.in.in 2010-05-31 17:41:58 +0000
+++ data/avant-window-navigator.schema-ini.in.in 2010-06-08 09:35:36 +0000
@@ -233,12 +233,6 @@
233_description=The offset of the Floaty background.233_description=The offset of the Floaty background.
234per_instance = false234per_instance = false
235235
236[theme/stripe_width]
237type = float
238default = 0.0
239_description=The width of the stripe in Lucido mode.
240per_instance = false
241
242[theme/dialog_gtk_mode]236[theme/dialog_gtk_mode]
243type = boolean237type = boolean
244default = true238default = true
245239
=== modified file 'src/awn-background-lucido.c'
--- src/awn-background-lucido.c 2010-05-31 22:40:18 +0000
+++ src/awn-background-lucido.c 2010-06-08 09:35:36 +0000
@@ -17,7 +17,7 @@
17 *17 *
18 * Author : Alberto Aldegheri <albyrock87+dev@gmail.com>18 * Author : Alberto Aldegheri <albyrock87+dev@gmail.com>
19 * Thanks to: Matt <sharkbaitbobby@gmail.com>19 * Thanks to: Matt <sharkbaitbobby@gmail.com>
20 * for the code section to analyze expanders20 * for the code section to analyze separators
21 *21 *
22 */22 */
2323
@@ -41,10 +41,13 @@
41{41{
42 gint expw;42 gint expw;
43 gint expn;43 gint expn;
44 gint expp;
44};45};
4546
46#define TRANSFORM_RADIUS(x) sqrt(x/50.)*50.47#define TRANSFORM_RADIUS(x) sqrt(x/50.)*50.
4748
49#define IS_SPECIAL(x) AWN_IS_SEPARATOR(x)
50
48static void awn_background_lucido_draw (AwnBackground *bg,51static void awn_background_lucido_draw (AwnBackground *bg,
49 cairo_t *cr,52 cairo_t *cr,
50 GtkPositionType position,53 GtkPositionType position,
@@ -66,12 +69,24 @@
66awn_background_lucido_get_needs_redraw (AwnBackground *bg,69awn_background_lucido_get_needs_redraw (AwnBackground *bg,
67 GtkPositionType position,70 GtkPositionType position,
68 GdkRectangle *area);71 GdkRectangle *area);
72
73static void
74_set_special_widget_width_and_transparent (AwnBackground *bg,
75 gint width,
76 gboolean transp,
77 gboolean dispose);
69 78
70static void 79static void
71awn_background_lucido_corner_radius_changed (AwnBackground *bg)80awn_background_lucido_corner_radius_changed (AwnBackground *bg)
72{81{
73 gboolean expand = FALSE;82 gboolean expand = FALSE;
74 g_object_get (bg->panel, "expand", &expand, NULL);83 g_object_get (bg->panel, "expand", &expand, NULL);
84
85 _set_special_widget_width_and_transparent (
86 bg,
87 TRANSFORM_RADIUS (bg->corner_radius),
88 TRUE,
89 FALSE);
75 90
76 if (!expand)91 if (!expand)
77 {92 {
@@ -100,7 +115,8 @@
100 gpointer monitor = NULL;115 gpointer monitor = NULL;
101 116
102 g_signal_connect_swapped (bg, "notify::corner-radius",117 g_signal_connect_swapped (bg, "notify::corner-radius",
103 G_CALLBACK (awn_background_lucido_corner_radius_changed),118 G_CALLBACK (
119 awn_background_lucido_corner_radius_changed),
104 object);120 object);
105121
106 g_return_if_fail (bg->panel);122 g_return_if_fail (bg->panel);
@@ -121,6 +137,8 @@
121static void137static void
122awn_background_lucido_dispose (GObject *object)138awn_background_lucido_dispose (GObject *object)
123{139{
140 _set_special_widget_width_and_transparent
141 (AWN_BACKGROUND (object), 10, FALSE, TRUE);
124 gpointer monitor = NULL;142 gpointer monitor = NULL;
125 if (AWN_BACKGROUND (object)->panel)143 if (AWN_BACKGROUND (object)->panel)
126 {144 {
@@ -211,6 +229,24 @@
211 return gtk_container_get_children (GTK_CONTAINER (manager));229 return gtk_container_get_children (GTK_CONTAINER (manager));
212}230}
213231
232static gint
233_get_applet_manager_size (AwnBackground* bg, GtkPositionType position)
234{
235 AwnAppletManager *manager = NULL;
236 g_object_get (bg->panel, "applet-manager", &manager, NULL);
237
238 switch (position)
239 {
240 case GTK_POS_BOTTOM:
241 case GTK_POS_TOP:
242 return GTK_WIDGET (manager)->allocation.width;
243 break;
244 default:
245 return GTK_WIDGET (manager)->allocation.height;
246 break;
247 }
248}
249
214/**250/**
215 * _create_path_lucido:251 * _create_path_lucido:
216 * @bg: The background pointer252 * @bg: The background pointer
@@ -219,17 +255,16 @@
219 * @y: The top left coordinate of the "bar rect" - default = 0255 * @y: The top left coordinate of the "bar rect" - default = 0
220 * @w: The width of the bar256 * @w: The width of the bar
221 * @h: The height of the bar257 * @h: The height of the bar
222 * @stripe: The width of the stripe (0.0-1.0). Zero for auto-stripe.
223 * @d: The width of each curve in the path258 * @d: The width of each curve in the path
224 * @dc: The width of the external curves in non-expanded&auto mode259 * @dc: The width of the external curves in non-expanded&auto mode
225 * @symmetry: The symmetry of the stripe when @stripe > 0
226 * @internal: If Zero, creates the path for the stripe260 * @internal: If Zero, creates the path for the stripe
227 * @expanded: If Zero, the bar is not expanded261 * @expanded: If Zero, the bar is not expanded
262 * @align: the monitor align
228 *263 *
229 * This function creates paths on which the bar will be drawn.264 * This function creates paths on which the bar will be drawn.
230 * In atuo-stripe, it searchs for expanders applet, each expander265 * In atuo-stripe, it searchs for separators applet, each separator
231 * equals to one curve.266 * equals to one curve.
232 * If the first widget is an expander, start from bottom-left,267 * If the first widget is an separator, start from bottom-left,
233 * otherwise start from top-left268 * otherwise start from top-left
234 */269 */
235270
@@ -241,316 +276,236 @@
241 gfloat y,276 gfloat y,
242 gfloat w,277 gfloat w,
243 gfloat h,278 gfloat h,
244 gfloat stripe,
245 gfloat d,279 gfloat d,
246 gfloat dc,280 gfloat dc,
247 gfloat symmetry,
248 gboolean internal,281 gboolean internal,
249 gboolean expanded,282 gboolean expanded,
250 gfloat align)283 gfloat align)
251{284{
252 cairo_new_path (cr);285 cairo_new_path (cr);
253286
287 gfloat curx = x;
254 gfloat lx = x;288 gfloat lx = x;
255 gfloat ly = y;289 gfloat ly = y;
256 gfloat y3 = y + h;290 gfloat y3 = y + h;
257 gfloat y2 = y3 - 5;291 gfloat y2 = y3 - 5;
258 292 gfloat pad_left = 0.;
259 if (stripe > 0)293
260 {294 /* Get list of widgets */
261 if (expanded)295 GList *widgets = _get_applet_widgets (bg);
262 {296 GList *i = widgets;
263 stripe = (w * stripe); /* now stripe = non-stripe */297 GtkWidget *widget = NULL;
264 if (internal)298 gboolean first_widget_is_special = FALSE;
265 {299 if (i && IS_SPECIAL (i->data))
266 /* Manual-Stripe & Expanded & Internal */300 {
267 lx = stripe * symmetry;301 first_widget_is_special = TRUE;
268 cairo_move_to (cr, lx, ly);302 }
269 _line_from_to (cr, &lx, &ly, lx+d, y2);303
270 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - d, y2);304 /* We start from left */
271 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry), y);305 ly = y3;
272 cairo_close_path (cr);306 cairo_move_to (cr, lx, ly);
273 }307
274 else308 if (expanded)
275 {309 {
276 /* Manual-Stripe & Expanded & External */310 pad_left = lx + (w - _get_applet_manager_size (bg, position)) * align;
277 ly = y3;311 if (first_widget_is_special)
278 cairo_move_to (cr, lx, ly);312 {
279 _line_from_to (cr, &lx, &ly, lx, y);313 /* start from bottom */
280 _line_from_to (cr, &lx, &ly, stripe * symmetry, y);314 if (internal)
281 _line_from_to (cr, &lx, &ly, stripe * symmetry + d, y2);315 {
282 _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry) - d, y2);316 cairo_new_path (cr);
283 _line_from_to (cr, &lx, &ly, w - stripe * (1. - symmetry), y);317 ly = y;
284 _line_from_to (cr, &lx, &ly, w, y);318 cairo_move_to (cr, lx, ly);
285 _line_from_to (cr, &lx, &ly, w, y3);319 }
286 cairo_close_path (cr);320
287 }321 _line_from_to (cr, &lx, &ly, lx, y2);
288 } 322 /* jump first special widget */
289 else323 i = i->next;
290 {324 }
291 if (stripe == 1.)325 else
292 {326 {
293 _create_path_lucido (bg, position, cr, x, y, w, h, 0., 327 /* start from top */
294 d, dc, 0., internal, expanded, align);328 if (internal)
295 return;329 {
296 }330 cairo_new_path (cr);
297 stripe = ((w - dc * 2) * stripe); /* now stripe = non-stripe */331 ly = y;
298 if (internal)332 cairo_move_to (cr, lx, ly);
299 {333 }
300 /* Manual-Stripe & Not-Expanded & Internal */334
301 lx = stripe * symmetry + dc;335 _line_from_to (cr, &lx, &ly, lx, y);
302 cairo_move_to (cr, lx, ly);336 }
303 _line_from_to (cr, &lx, &ly, lx + d, y2);337 }
304 _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc - d, y2);338 else
305 _line_from_to (cr, &lx, &ly, w - stripe * (1.- symmetry) - dc, y);339 {
306 cairo_close_path (cr);340 if (align == 0.)
307 }341 {
308 else342 if (first_widget_is_special)
309 {343 {
310 /* Manual-Stripe & Not-Expanded & External */344 /* start from bottom */
311 ly = y3;345 if (internal)
312 cairo_move_to (cr, lx, ly);346 {
313 _line_from_to (cr, &lx, &ly, lx+dc, y);347 cairo_new_path (cr);
314 _line_from_to (cr, &lx, &ly, stripe * symmetry + dc, y);348 ly = y;
315 _line_from_to (cr, &lx, &ly, stripe * symmetry + d + dc, y2);349 cairo_move_to (cr, lx, ly);
316 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc - d, y2);350 }
317 _line_from_to (cr, &lx, &ly, w-stripe * (1. - symmetry) - dc, y);351 _line_from_to (cr, &lx, &ly, lx, y2);
318 _line_from_to (cr, &lx, &ly, w-dc, y);352 /* jump first special widget */
319 _line_from_to (cr, &lx, &ly, w, y3);353 i = i->next;
320 cairo_close_path(cr);354 }
321 }355 else
322 }356 {
323 }357 if (internal)
324 else358 {
325 {359 cairo_new_path (cr);
326 gint exps_found = 0;360 ly = y;
327 gfloat curx = x;361 cairo_move_to (cr, lx, ly);
328 362 }
329 if (expanded)363 else
330 {364 {
331 if (internal)365 /* start from top */
332 { 366 _line_from_to (cr, &lx, &ly, lx, y);
333 /* Auto-Stripe & Expanded & Internal */367 }
334 GList *widgets = _get_applet_widgets (bg);368 }
335 GList *i = widgets;369 }
336 GtkWidget *widget = NULL;370 else
337 371 {
338 /* analyze first widget*/372 pad_left = lx + dc;
339 if (i)373 if (first_widget_is_special)
340 {374 {
341 widget = GTK_WIDGET (i->data);375 /* start from bottom */
342 376 if (internal)
343 /* if first widget is an expander or align==0 || 1*/377 {
344 if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) ||378 cairo_new_path (cr);
345 ( align == 0. || align == 1. ) )379 lx = lx + dc;
346 {380 ly = y;
347 /* start from bottom */381 cairo_move_to (cr, lx, ly);
348 lx = curx;382 _line_from_to (cr, &lx, &ly, curx, y3);
349 ly = y;383 _line_from_to (cr, &lx, &ly, lx + dc, y2);
350 cairo_move_to (cr, lx, ly);384 }
351 _line_from_to (cr, &lx, &ly, lx, y2);385 else
352 ++exps_found;386 {
353 if (align != 0. && align != 1.)387 _line_from_to (cr, &lx, &ly, lx + dc, y2);
354 i = i->next;388 /* jump first special widget */
355 }389 }
356 }390 i = i->next;
357 /* else start from top */391 }
358392 else
359 for (; i; i = i->next)393 {
360 {394 /* start from top */
361 widget = GTK_WIDGET (i->data);395 if (internal)
362396 {
363 if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget)) 397 cairo_new_path (cr);
364 {398 ly = y;
365 /* if not expander continue */399 lx = lx + dc;
366 continue;400 cairo_move_to (cr, lx, ly);
367 } 401 }
368 /* expander found */402 else
369 switch (position)403 {
370 {404 _line_from_to (cr, &lx, &ly, lx + dc, y);
371 case GTK_POS_BOTTOM:405 }
372 case GTK_POS_TOP:406 }
373 curx = widget->allocation.x;407 }
374 if (exps_found % 2 != 0)408 }
375 {409 /* "first curve" done. */
376 curx += widget->allocation.width;410 /* now we are on y or y2 */
377 }411 /* start loop on widgets */
378 break;412 curx = lx;
379 default:413 for (; i; i = i->next)
380 curx = widget->allocation.y;414 {
381 if ( exps_found % 2 != 0)415 widget = GTK_WIDGET (i->data);
382 {416
383 curx += widget->allocation.height;417 if (!IS_SPECIAL (widget))
384 }418 {
385 break;419 /* if not special continue */
386 }420 continue;
387 if (curx < 0)421 }
388 {422 /* special found */
389 continue;423 switch (position)
390 }424 {
391425 case GTK_POS_BOTTOM:
392 if (exps_found == 0)426 case GTK_POS_TOP:
393 {427 curx = widget->allocation.x + pad_left;
394 /* this is the first expander */ 428 break;
395 lx = curx;429 default:
396 cairo_move_to (cr, lx, ly);430 curx = widget->allocation.y + pad_left;
397 _line_from_to (cr, &lx, &ly, curx + d, y2);431 break;
398 }432 }
399 else433 if ((curx - pad_left) < 0)
400 {434 {
401 if (exps_found % 2 != 0)435 continue;
402 {436 }
403 /* odd expander - curve at the end of expander */437 _line_from_to (cr, &lx, &ly, curx, ly);
404 _line_from_to (cr, &lx, &ly, curx - d, y2);438 if (ly == y2)
405 if (i->next == NULL)439 {
406 _line_from_to (cr, &lx, &ly, curx, y2);440 _line_from_to (cr, &lx, &ly, lx + d, y);
407 _line_from_to (cr, &lx, &ly, curx, y);441 }
408 }442 else
409 else443 {
410 {444 _line_from_to (cr, &lx, &ly, lx + d, y2);
411 /* even expander - curve at the start of expander */445 }
412 _line_from_to (cr, &lx, &ly, curx, y);446 }
413 _line_from_to (cr, &lx, &ly, curx + d, y2);447 g_list_free (widgets);
414 /* else the last widget is an expander */448 if (expanded)
415 }449 {
416 }450 /* make sure that cairo close path in the right way */
417451 _line_from_to (cr, &lx, &ly, w, ly);
418 ++exps_found;452 if (internal)
419 }453 {
420 g_list_free (widgets);454 _line_from_to (cr, &lx, &ly, lx, y);
421455 }
422 _line_from_to (cr, &lx, &ly, w, ly);456 else
423457 {
424 if (exps_found % 2 != 0)458 _line_from_to (cr, &lx, &ly, lx, y3);
425 {459 }
426 _line_from_to (cr, &lx, &ly, lx, y);460 }
427 }461 else
428462 {
429 cairo_close_path (cr);463 if (align == 1.)
430 }464 {
431 else465 if (internal)
432 {466 {
433 /* Auto-Stripe & Expanded & External */467 if (ly == y2)
434468 {
435 GList *widgets = _get_applet_widgets (bg);469 _line_from_to (cr, &lx, &ly, w, ly);
436 GList *i = widgets;470 _line_from_to (cr, &lx, &ly, lx, y);
437 GtkWidget *widget = NULL;471 }
438 472 /* else close path */
439 /* analyze first widget*/473 }
440 if (i)474 else
441 {475 {
442 widget = GTK_WIDGET (i->data);
443
444 ly = y3;
445 cairo_move_to (cr, lx, ly);
446
447 /* if first widget is an expander or align==0 || 1*/
448 if ( (widget && GTK_IS_IMAGE (widget) && !AWN_IS_SEPARATOR (widget) ) ||
449 ( align == 0. || align == 1. ) )
450 {
451 /* start from bottom */
452 _line_from_to (cr, &lx, &ly, lx, y2);
453 ++exps_found;
454 if (align != 0. && align != 1.)
455 i = i->next;
456 }
457 else
458 {
459 /* start from top */
460 _line_from_to (cr, &lx, &ly, lx, y);
461 }
462 }
463
464 for (; i; i = i->next)
465 {
466 widget = GTK_WIDGET (i->data);
467
468 if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget))
469 {
470 /* if not expander continue */
471 continue;
472 }
473 /* expander found */
474 switch (position)
475 {
476 case GTK_POS_BOTTOM:
477 case GTK_POS_TOP:
478 curx = widget->allocation.x;
479 if (exps_found % 2 != 0)
480 {
481 curx += widget->allocation.width;
482 }
483 break;
484 default:
485 curx = widget->allocation.y;
486 if (exps_found % 2 != 0)
487 {
488 curx += widget->allocation.height;
489 }
490 break;
491 }
492 if (curx < 0)
493 {
494 continue;
495 }
496
497 if (exps_found % 2 != 0)
498 {
499 _line_from_to (cr, &lx, &ly, curx - d, y2);
500 if (i->next != NULL)
501 _line_from_to (cr, &lx, &ly, curx, y);
502 }
503 else
504 {
505 _line_from_to (cr, &lx, &ly, curx, y);
506 _line_from_to (cr, &lx, &ly, curx + d, y2);
507 }
508 ++exps_found;
509 }
510 g_list_free (widgets);
511
512 _line_from_to (cr, &lx, &ly, w, ly);476 _line_from_to (cr, &lx, &ly, w, ly);
513 _line_from_to (cr, &lx, &ly, lx, y3);477 _line_from_to (cr, &lx, &ly, lx, y3);
514
515 cairo_close_path (cr);
516 }478 }
517 }479 }
518 else480 else
519 {481 {
520 if (internal)482 if (internal)
521 {483 {
522 /* Auto-Stripe & Not-Expanded & Internal */484 if (ly == y2)
523 /* no-path */485 {
524 }486 _line_from_to (cr, &lx, &ly, w - dc, y2);
525 else487 _line_from_to (cr, &lx, &ly, w, y3);
526 {
527 /* Auto-Stripe & Not-Expanded & External */
528 ly = y3;
529 cairo_move_to (cr, lx, ly);
530
531 if (align == 0.)
532 _line_from_to (cr, &lx, &ly, lx , y);
533 else
534 _line_from_to (cr, &lx, &ly, lx + dc, y);
535
536 if (align == 1.)
537 _line_from_to (cr, &lx, &ly, w, y);
538 else
539 _line_from_to (cr, &lx, &ly, w - dc, y);488 _line_from_to (cr, &lx, &ly, w - dc, y);
540 489 }
490 /* else close path */
491 }
492 else
493 {
494 _line_from_to (cr, &lx, &ly, w - dc, ly);
541 _line_from_to (cr, &lx, &ly, w, y3);495 _line_from_to (cr, &lx, &ly, w, y3);
542 cairo_close_path (cr);
543 }496 }
544 }497 }
545 }498 }
499 cairo_close_path (cr);
500
546}501}
547502
548static void503static void
549draw_top_bottom_background (AwnBackground* bg,504draw_top_bottom_background (AwnBackground* bg,
550 GtkPositionType position,505 GtkPositionType position,
551 cairo_t* cr,506 cairo_t* cr,
552 gint width,507 gfloat width,
553 gint height)508 gfloat height)
554{509{
555 cairo_pattern_t *pat = NULL;510 cairo_pattern_t *pat = NULL;
556 cairo_pattern_t *pat_hi = NULL;511 cairo_pattern_t *pat_hi = NULL;
@@ -565,16 +520,9 @@
565 gfloat align = awn_background_get_panel_alignment (AWN_BACKGROUND (bg));520 gfloat align = awn_background_get_panel_alignment (AWN_BACKGROUND (bg));
566 521
567 /* Make sure the bar gets drawn on the 0.5 pixels (for sharp edges) */522 /* Make sure the bar gets drawn on the 0.5 pixels (for sharp edges) */
568 switch (position)523 cairo_translate (cr, 0.5, 0.5);
569 {524 width -= 0.5;
570 case GTK_POS_TOP:525 height -= 0.5;
571 case GTK_POS_BOTTOM:
572 cairo_translate (cr, 0., 0.5);
573 break;
574 default:
575 cairo_translate (cr, 0.5, 0.);
576 break;
577 }
578 526
579 if (gtk_widget_is_composited (GTK_WIDGET (bg->panel)) == FALSE)527 if (gtk_widget_is_composited (GTK_WIDGET (bg->panel)) == FALSE)
580 {528 {
@@ -583,12 +531,12 @@
583531
584 /* create internal path */532 /* create internal path */
585 _create_path_lucido (bg, position, cr, -1.0, 0., width, height,533 _create_path_lucido (bg, position, cr, -1.0, 0., width, height,
586 bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius),534 TRANSFORM_RADIUS (bg->corner_radius),
587 TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry,535 TRANSFORM_RADIUS (bg->corner_radius),
588 1, expand, align);536 1, expand, align);
589537
590 /* Draw internal pattern if needed */538 /* Draw internal pattern if needed */
591 if ((expand || bg->stripe_width != 0.) && bg->enable_pattern && bg->pattern)539 if (bg->enable_pattern && bg->pattern)
592 {540 {
593 /* Prepare pattern */541 /* Prepare pattern */
594 pat_hi = cairo_pattern_create_for_surface (bg->pattern);542 pat_hi = cairo_pattern_create_for_surface (bg->pattern);
@@ -601,6 +549,13 @@
601 cairo_restore (cr);549 cairo_restore (cr);
602 cairo_pattern_destroy (pat_hi);550 cairo_pattern_destroy (pat_hi);
603 }551 }
552 /* Prepare the hi-light */
553 pat_hi = cairo_pattern_create_linear (0, 0, 0, height);
554 awn_cairo_pattern_add_color_stop_color (pat_hi, 0.0, bg->g_histep_1);
555 awn_cairo_pattern_add_color_stop_color (pat_hi, 0.3, bg->g_histep_2);
556 double red, green, blue, alpha;
557 desktop_agnostic_color_get_cairo_color (bg->g_histep_2, &red, &green, &blue, &alpha);
558 cairo_pattern_add_color_stop_rgba (pat_hi, 0.4, red, green, blue, 0.);
604559
605 /* Prepare the internal background */560 /* Prepare the internal background */
606 pat = cairo_pattern_create_linear (0, 0, 0, height);561 pat = cairo_pattern_create_linear (0, 0, 0, height);
@@ -613,36 +568,25 @@
613 cairo_set_source (cr, pat);568 cairo_set_source (cr, pat);
614 cairo_paint (cr);569 cairo_paint (cr);
615 cairo_restore (cr);570 cairo_restore (cr);
616571 /* Draw the internal hi-light gradient */
617 /* Prepare external background gradient*/572 cairo_save (cr);
618 if (expand || bg->stripe_width != 0.)573 cairo_clip (cr);
619 {574 cairo_set_source (cr, pat_hi);
620 cairo_pattern_destroy (pat);575 cairo_paint (cr);
621 pat = cairo_pattern_create_linear (0, 0, 0, height);576 cairo_restore (cr);
622 awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->g_step_1);577
623 awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->g_step_2);578 /* Prepare external background gradient*/
624 }579 cairo_pattern_destroy (pat);
580 pat = cairo_pattern_create_linear (0, 0, 0, height);
581 awn_cairo_pattern_add_color_stop_color (pat, 0.0, bg->g_step_1);
582 awn_cairo_pattern_add_color_stop_color (pat, 1.0, bg->g_step_2);
583
625 584
626 /* create external path */585 /* create external path */
627 _create_path_lucido (bg, position, cr, -1.0, 0., width, height,586 _create_path_lucido (bg, position, cr, -1.0, 0., width, height,
628 bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius),587 TRANSFORM_RADIUS (bg->corner_radius),
629 TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry,588 TRANSFORM_RADIUS (bg->corner_radius),
630 0, expand, align);589 0, expand, align);
631
632 /* Draw external pattern if needed */
633 if (!expand && bg->stripe_width == 0. && bg->enable_pattern && bg->pattern)
634 {
635 /* Prepare pattern */
636 pat_hi = cairo_pattern_create_for_surface (bg->pattern);
637 cairo_pattern_set_extend (pat_hi, CAIRO_EXTEND_REPEAT);
638 /* Draw */
639 cairo_save (cr);
640 cairo_clip_preserve (cr);
641 cairo_set_source (cr, pat_hi);
642 cairo_paint (cr);
643 cairo_restore (cr);
644 cairo_pattern_destroy (pat_hi);
645 }
646 590
647 /* Draw the external background */591 /* Draw the external background */
648 cairo_save (cr);592 cairo_save (cr);
@@ -652,19 +596,13 @@
652 cairo_restore (cr);596 cairo_restore (cr);
653 cairo_pattern_destroy (pat);597 cairo_pattern_destroy (pat);
654 598
655 /* Draw the hi-light */599 /* Draw the internal hi-light gradient */
656 pat_hi = cairo_pattern_create_linear (0, 0, 0, (height / 3.0));600 cairo_save (cr);
657 awn_cairo_pattern_add_color_stop_color (pat_hi, 0.0, bg->g_histep_1);601 cairo_clip (cr);
658 awn_cairo_pattern_add_color_stop_color (pat_hi, 1.0, bg->g_histep_2);
659
660 if (expand)
661 {
662 cairo_new_path (cr);
663 cairo_rectangle (cr, 0, 0, width, (height / 3.0));
664 }
665
666 cairo_set_source (cr, pat_hi);602 cairo_set_source (cr, pat_hi);
667 cairo_fill (cr);603 cairo_paint (cr);
604 cairo_restore (cr);
605
668 cairo_pattern_destroy (pat_hi);606 cairo_pattern_destroy (pat_hi);
669607
670 return;608 return;
@@ -686,14 +624,14 @@
686 {624 {
687 awn_cairo_set_source_color (cr, bg->border_color);625 awn_cairo_set_source_color (cr, bg->border_color);
688 _create_path_lucido (bg, position, cr, 0., 0., width, height,626 _create_path_lucido (bg, position, cr, 0., 0., width, height,
689 bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius),627 TRANSFORM_RADIUS (bg->corner_radius),
690 TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry,628 TRANSFORM_RADIUS (bg->corner_radius),
691 0, expand, align);629 0, expand, align);
692 cairo_stroke (cr);630 cairo_stroke (cr);
693 awn_cairo_set_source_color (cr, bg->hilight_color);631 awn_cairo_set_source_color (cr, bg->hilight_color);
694 _create_path_lucido (bg, position, cr, 1., 1., width-1., height-1.,632 _create_path_lucido (bg, position, cr, 1., 1., width-1., height-1.,
695 bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius),633 TRANSFORM_RADIUS (bg->corner_radius),
696 TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry,634 TRANSFORM_RADIUS (bg->corner_radius),
697 0, expand, align);635 0, expand, align);
698 }636 }
699 cairo_stroke (cr);637 cairo_stroke (cr);
@@ -800,6 +738,39 @@
800 cairo_restore (cr);738 cairo_restore (cr);
801}739}
802740
741static void
742_set_special_widget_width_and_transparent (AwnBackground *bg,
743 gint width,
744 gboolean transp,
745 gboolean dispose)
746{
747 GList *widgets = _get_applet_widgets (bg);
748 GList *i = widgets;
749 GtkWidget *widget = NULL;
750
751 if (i && IS_SPECIAL (i->data) && !dispose)
752 {
753 widget = GTK_WIDGET (i->data);
754 g_object_set (G_OBJECT (widget), "separator-size", 0, NULL);
755 g_object_set (G_OBJECT (widget), "transparent", transp, NULL);
756 i = i->next;
757 }
758
759 for (; i; i = i->next)
760 {
761 widget = GTK_WIDGET (i->data);
762 if (!IS_SPECIAL (widget))
763 {
764 /* if not special continue */
765 continue;
766 }
767 g_object_set (G_OBJECT (widget), "separator-size", width, NULL);
768 g_object_set (G_OBJECT (widget), "transparent", transp, NULL);
769 }
770
771 g_list_free (widgets);
772}
773
803static gboolean774static gboolean
804awn_background_lucido_get_needs_redraw (AwnBackground *bg,775awn_background_lucido_get_needs_redraw (AwnBackground *bg,
805 GtkPositionType position,776 GtkPositionType position,
@@ -813,45 +784,55 @@
813 return TRUE;784 return TRUE;
814 }785 }
815 786
816 /* Check expanders positions & sizes changed */787 /* Check separators positions & sizes changed */
817 GList *widgets = _get_applet_widgets (bg);788 GList *widgets = _get_applet_widgets (bg);
818 GList *i = widgets;789 GList *i = widgets;
819 GtkWidget *widget = NULL;790 GtkWidget *widget = NULL;
820 gint wcheck = 0;791 gint wcheck = 0;
821 gint ncheck = 0;792 gint ncheck = 0;
793 gint pcheck = 0;
822 794
823 for (; i; i = i->next)795 for (; i; i = i->next)
824 {796 {
825 widget = GTK_WIDGET (i->data);797 widget = GTK_WIDGET (i->data);
826798 if (!IS_SPECIAL (widget))
827 if (!GTK_IS_IMAGE (widget) || AWN_IS_SEPARATOR (widget))
828 {799 {
829 /* if not expander continue */800 /* if not special continue */
830 continue;801 continue;
831 }802 }
832 switch (position)
833 {
834 case GTK_POS_BOTTOM:
835 case GTK_POS_TOP:
836 wcheck += (widget->allocation.x * 3) / 2 + widget->allocation.width;
837 break;
838 default:
839 wcheck += (widget->allocation.y * 3 ) / 2 + widget->allocation.height;
840 break;
841 }
842 ++ncheck;803 ++ncheck;
804 pcheck += ncheck;
805 switch (position)
806 {
807 case GTK_POS_BOTTOM:
808 case GTK_POS_TOP:
809 wcheck += (widget->allocation.x * ncheck);
810 break;
811 default:
812 wcheck += (widget->allocation.y * ncheck);
813 break;
814 }
843 }815 }
844 g_list_free (widgets);816 g_list_free (widgets);
845 817
818 pcheck += _get_applet_manager_size (bg, position);
819
846 AwnBackgroundLucido *lbg = NULL;820 AwnBackgroundLucido *lbg = NULL;
847 lbg = AWN_BACKGROUND_LUCIDO (bg);821 lbg = AWN_BACKGROUND_LUCIDO (bg);
848 AwnBackgroundLucidoPrivate *priv;822 AwnBackgroundLucidoPrivate *priv;
849 priv = AWN_BACKGROUND_LUCIDO_GET_PRIVATE (lbg);823 priv = AWN_BACKGROUND_LUCIDO_GET_PRIVATE (lbg);
850 if (priv->expn != ncheck)824 if (priv->expn != ncheck)
851 {825 {
852 priv->expn = ncheck;826 _set_special_widget_width_and_transparent
827 (bg, TRANSFORM_RADIUS (bg->corner_radius), TRUE, FALSE);
828 }
829
830 if (priv->expp != pcheck)
831 {
832 priv->expp = pcheck;
853 /* used to refresh bar */833 /* used to refresh bar */
854 awn_background_emit_padding_changed (bg);834 awn_background_emit_changed (bg);
835 return TRUE;
855 }836 }
856 if (priv->expw != wcheck)837 if (priv->expw != wcheck)
857 {838 {
@@ -911,9 +892,15 @@
911 else892 else
912 {893 {
913 _create_path_lucido (bg, position, cr, 0, 0., width, height,894 _create_path_lucido (bg, position, cr, 0, 0., width, height,
914 bg->stripe_width, TRANSFORM_RADIUS (bg->corner_radius),895 TRANSFORM_RADIUS (bg->corner_radius),
915 TRANSFORM_RADIUS (bg->corner_radius), bg->curves_symmetry,896 TRANSFORM_RADIUS (bg->corner_radius),
916 0, expand, align);897 0, expand, align);
898 cairo_fill (cr);
899 _create_path_lucido (bg, position, cr, 0, 0., width, height,
900 TRANSFORM_RADIUS (bg->corner_radius),
901 TRANSFORM_RADIUS (bg->corner_radius),
902 1, expand, align);
903
917 }904 }
918 cairo_fill (cr);905 cairo_fill (cr);
919906
920907
=== modified file 'src/awn-background.c'
--- src/awn-background.c 2010-06-02 09:54:30 +0000
+++ src/awn-background.c 2010-06-08 09:35:36 +0000
@@ -59,8 +59,7 @@
59 PROP_PANEL_ANGLE,59 PROP_PANEL_ANGLE,
60 PROP_CURVINESS,60 PROP_CURVINESS,
61 PROP_CURVES_SYMEMETRY,61 PROP_CURVES_SYMEMETRY,
62 PROP_FLOATY_OFFSET,62 PROP_FLOATY_OFFSET
63 PROP_STRIPE_WIDTH
64};63};
6564
66enum 65enum
@@ -197,11 +196,6 @@
197 object, "curves-symmetry", TRUE,196 object, "curves-symmetry", TRUE,
198 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,197 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
199 NULL);198 NULL);
200 desktop_agnostic_config_client_bind (bg->client,
201 AWN_GROUP_THEME, AWN_THEME_STRIPE_WIDTH,
202 object, "stripe-width", TRUE,
203 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
204 NULL);
205}199}
206200
207static void201static void
@@ -367,9 +361,6 @@
367 case PROP_FLOATY_OFFSET:361 case PROP_FLOATY_OFFSET:
368 bg->floaty_offset = g_value_get_int (value);362 bg->floaty_offset = g_value_get_int (value);
369 break;363 break;
370 case PROP_STRIPE_WIDTH:
371 bg->stripe_width = g_value_get_float (value);
372 break;
373364
374 default:365 default:
375 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);366 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -620,15 +611,6 @@
620 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |611 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
621 G_PARAM_STATIC_STRINGS));612 G_PARAM_STATIC_STRINGS));
622 613
623 g_object_class_install_property (obj_class,
624 PROP_STRIPE_WIDTH,
625 g_param_spec_float ("stripe-width",
626 "Stripe Width",
627 "The width of the stripe",
628 0.0, 1.0, 0.0,
629 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
630 G_PARAM_STATIC_STRINGS));
631
632 /* Add signals to the class */614 /* Add signals to the class */
633 _bg_signals[CHANGED] = 615 _bg_signals[CHANGED] =
634 g_signal_new ("changed",616 g_signal_new ("changed",
635617
=== modified file 'src/awn-background.h'
--- src/awn-background.h 2010-05-31 17:41:58 +0000
+++ src/awn-background.h 2010-06-08 09:35:36 +0000
@@ -99,7 +99,6 @@
99 gint floaty_offset;99 gint floaty_offset;
100 gfloat curviness;100 gfloat curviness;
101 gfloat curves_symmetry;101 gfloat curves_symmetry;
102 gfloat stripe_width;
103102
104 /* private */103 /* private */
105 guint changed;104 guint changed;
106105
=== modified file 'src/awn-defines.h'
--- src/awn-defines.h 2010-05-31 17:41:58 +0000
+++ src/awn-defines.h 2010-06-08 09:35:36 +0000
@@ -88,7 +88,6 @@
88#define AWN_THEME_CURVINESS "curviness"88#define AWN_THEME_CURVINESS "curviness"
89#define AWN_THEME_CURVES_SYMMETRY "curves_symmetry"89#define AWN_THEME_CURVES_SYMMETRY "curves_symmetry"
90#define AWN_THEME_FLOATY_OFFSET "floaty_offset"90#define AWN_THEME_FLOATY_OFFSET "floaty_offset"
91#define AWN_THEME_STRIPE_WIDTH "stripe_width"
9291
93#endif /*_HAVE_AWN_DEFINES_H */92#endif /*_HAVE_AWN_DEFINES_H */
9493
9594
=== modified file 'src/awn-separator.c'
--- src/awn-separator.c 2010-01-01 21:35:47 +0000
+++ src/awn-separator.c 2010-06-08 09:35:36 +0000
@@ -34,7 +34,9 @@
34 GtkPositionType position;34 GtkPositionType position;
35 gint offset;35 gint offset;
36 gint size;36 gint size;
37 gint separator_size;
3738
39 gboolean transparent;
38 DesktopAgnosticColor *sep_color;40 DesktopAgnosticColor *sep_color;
39};41};
4042
@@ -47,7 +49,10 @@
47 PROP_OFFSET,49 PROP_OFFSET,
48 PROP_SIZE,50 PROP_SIZE,
4951
50 PROP_SEP_COLOR52 PROP_SEP_COLOR,
53 PROP_SEP_TRANSPARENT,
54
55 PROP_SEP_SIZE
51};56};
5257
53static void58static void
@@ -78,6 +83,12 @@
78 case PROP_SEP_COLOR:83 case PROP_SEP_COLOR:
79 g_value_set_object (value, priv->sep_color);84 g_value_set_object (value, priv->sep_color);
80 break;85 break;
86 case PROP_SEP_SIZE:
87 g_value_set_int (value, priv->separator_size);
88 break;
89 case PROP_SEP_TRANSPARENT:
90 g_value_set_boolean (value, priv->transparent);
91 break;
81 default:92 default:
82 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);93 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
83 }94 }
@@ -126,6 +137,18 @@
126 priv->sep_color = g_value_dup_object (value);137 priv->sep_color = g_value_dup_object (value);
127 gtk_widget_queue_draw (GTK_WIDGET (object));138 gtk_widget_queue_draw (GTK_WIDGET (object));
128 break;139 break;
140 case PROP_SEP_SIZE:
141 temp = g_value_get_int (value);
142 if (temp == priv->separator_size) break;
143 priv->separator_size = temp;
144 gtk_widget_queue_resize (GTK_WIDGET (object));
145 break;
146 case PROP_SEP_TRANSPARENT:
147 temp = g_value_get_boolean (value);
148 if (temp == priv->transparent) break;
149 priv->transparent = temp;
150 gtk_widget_queue_draw (GTK_WIDGET (object));
151 break;
129 default:152 default:
130 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);153 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
131 }154 }
@@ -181,13 +204,13 @@
181 {204 {
182 case GTK_POS_TOP:205 case GTK_POS_TOP:
183 case GTK_POS_BOTTOM:206 case GTK_POS_BOTTOM:
184 req->width = 10;207 req->width = priv->separator_size;
185 req->height = priv->size + priv->offset;208 req->height = priv->size + priv->offset;
186 break;209 break;
187 case GTK_POS_LEFT:210 case GTK_POS_LEFT:
188 case GTK_POS_RIGHT:211 case GTK_POS_RIGHT:
189 req->width = priv->size + priv->offset;212 req->width = priv->size + priv->offset;
190 req->height = 10;213 req->height = priv->separator_size;
191 break;214 break;
192 default:215 default:
193 break;216 break;
@@ -198,12 +221,18 @@
198awn_separator_expose (GtkWidget *widget, GdkEventExpose *event)221awn_separator_expose (GtkWidget *widget, GdkEventExpose *event)
199{222{
200 AwnSeparatorPrivate *priv = AWN_SEPARATOR (widget)->priv;223 AwnSeparatorPrivate *priv = AWN_SEPARATOR (widget)->priv;
224
225 if (priv->transparent)
226 {
227 return TRUE;
228 }
229
201 cairo_t *cr;230 cairo_t *cr;
202 cairo_path_t *path;231 cairo_path_t *path;
203 GtkOrientation orient;232 GtkOrientation orient;
204 cairo_pattern_t *pat = NULL, *shadow_pat = NULL;233 cairo_pattern_t *pat = NULL, *shadow_pat = NULL;
205 gdouble r, g, b, a;234 gdouble r, g, b, a;
206235
207 cr = gdk_cairo_create (widget->window);236 cr = gdk_cairo_create (widget->window);
208 g_return_val_if_fail (cr, FALSE);237 g_return_val_if_fail (cr, FALSE);
209238
@@ -366,6 +395,24 @@
366 DESKTOP_AGNOSTIC_TYPE_COLOR,395 DESKTOP_AGNOSTIC_TYPE_COLOR,
367 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));396 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
368397
398 g_object_class_install_property (object_class,
399 PROP_SEP_SIZE,
400 g_param_spec_int ("separator-size",
401 "Separator Size",
402 "The size of the separator",
403 0, G_MAXINT, 10,
404 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
405 G_PARAM_STATIC_STRINGS));
406
407 g_object_class_install_property (object_class,
408 PROP_SEP_TRANSPARENT,
409 g_param_spec_boolean ("transparent",
410 "Transparent",
411 "Is separator transparent?",
412 FALSE,
413 G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
414 G_PARAM_STATIC_STRINGS));
415
369 g_type_class_add_private (klass, sizeof (AwnSeparatorPrivate));416 g_type_class_add_private (klass, sizeof (AwnSeparatorPrivate));
370}417}
371418

Subscribers

People subscribed via source and target branches