diff options
author | Monsta <[email protected]> | 2015-12-16 11:55:15 +0300 |
---|---|---|
committer | Monsta <[email protected]> | 2015-12-16 11:55:15 +0300 |
commit | ad71ff5c734e9f410b9e4c1b08f107c4b7057eaa (patch) | |
tree | 3b24bedee89706f7c3c8f89cdf4fa40cf6ba601b | |
parent | c6f308d841e7a93ed4c3dbefed0686aaddf99d34 (diff) | |
download | mate-netbook-ad71ff5c734e9f410b9e4c1b08f107c4b7057eaa.tar.bz2 mate-netbook-ad71ff5c734e9f410b9e4c1b08f107c4b7057eaa.tar.xz |
window picker: update task item drawing code from gnome-applets
-rw-r--r-- | mate-window-picker-applet/task-item.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/mate-window-picker-applet/task-item.c b/mate-window-picker-applet/task-item.c index 24a4806..4d7c0d2 100644 --- a/mate-window-picker-applet/task-item.c +++ b/mate-window-picker-applet/task-item.c @@ -325,13 +325,35 @@ task_item_expose_event (GtkWidget *widget, if (active) { - cairo_rectangle (cr, area.x + .5, area.y - 4, area.width - 1, area.height + 8); + cairo_rectangle (cr, area.x + 1, area.y - 1, area.width - 2, area.height - 2); cairo_set_source_rgba (cr, .8, .8, .8, .2); cairo_fill_preserve (cr); - - cairo_set_line_width (cr, 1); - cairo_set_source_rgba (cr, .8, .8, .8, .4); - cairo_stroke (cr); + if (priv->mouse_over) + { + cairo_set_source_rgba (cr, .9, .9, 1, 0.45); + cairo_stroke (cr); + } + else + { + cairo_set_line_width (cr, 1); + cairo_set_source_rgba (cr, .8, .8, .8, .4); + cairo_stroke (cr); + } + } + else if (priv->mouse_over) + { + int glow_x, glow_y; + cairo_pattern_t *glow_pattern; + glow_x = area.width / 2; + glow_y = area.height / 2; + glow_pattern = cairo_pattern_create_radial ( + area.x + glow_x, area.y + glow_y, glow_x * 0.3, + area.x + glow_x, area.y + glow_y, glow_x * 1.4 + ); + cairo_pattern_add_color_stop_rgba (glow_pattern, 0, 1, 1, 1, 1); + cairo_pattern_add_color_stop_rgba (glow_pattern, 0.6, 1, 1, 1, 0); + cairo_set_source (cr, glow_pattern); + cairo_paint (cr); } if (!pbuf) @@ -359,7 +381,7 @@ task_item_expose_event (GtkWidget *widget, gdk_pixbuf_saturate_and_pixelate (pbuf, desat, 0, - FALSE); + FALSE); } else /* just paint the colored version as a fallback */ { |