[Xfce4-commits] [xfce/xfdesktop] 01/01: Add a description of the property shadow-blur-radius on README file. (Bug 11228)
noreply at xfce.org
noreply at xfce.org
Thu Oct 16 18:05:52 CEST 2014
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository xfce/xfdesktop.
commit 2df1084704efaac8b625a943dc9e8c46a0b0cd0a
Author: Matias De lellis <mati86dl at gmail.com>
Date: Thu Oct 16 12:41:00 2014 -0300
Add a description of the property shadow-blur-radius on README file. (Bug 11228)
Ensure that shadow_blur_radius > 1 before call to paint the shadow.
Save the cairo_t before change it, and so can be recovered correctly.
Signed-off-by: Eric Koegel <eric.koegel at gmail.com>
---
README | 10 +++++++---
src/xfdesktop-icon-view.c | 6 ++++--
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/README b/README
index 917a7cc..14c1529 100644
--- a/README
+++ b/README
@@ -51,6 +51,7 @@ style "xfdesktop-icon-view" {
XfdesktopIconView::selected-shadow-x-offset = 2
XfdesktopIconView::selected-shadow-y-offset = 2
XfdesktopIconView::selected-shadow-color = "#00ff00"
+ XfdesktopIconView::shadow-blur-radius = 2
XfdesktopIconView::cell-spacing = 2
XfdesktopIconView::cell-padding = 6
@@ -75,10 +76,13 @@ determines how large the image preview will be when the mouse is hovered
over an icon (allowed values are from 0 (not shown) to 512, values larger
than 256 may cause poor image quality however.)
-The second six entries can be used to enable a text shadow to be painted
-with the icon labels. The offsets are in pixels. Setting them to 0 (the
+The second seven entries can be used to enable a text shadow to be painted
+with the icon labels. The offsets are in pixels. Setting them to 0 (the
defaults) will disable the shadows entirely. Again, the 'selected-'
-versions apply to icons that have been selected with the mouse.
+versions apply to icons that have been selected with the mouse. The
+shadow-blur-radius property optionally applies a blur to the shadows when
+it is greater than 1 improving the style, but needs a little more CPU
+processing, and therefore also is disabled by default.
The third four entries set spacing and sizing for individual icons on
the grid. The 'cell-spacing' property specifies the spacing between each
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index cade043..f425ef2 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -2975,6 +2975,8 @@ xfdesktop_icon_view_draw_text(cairo_t *cr, PangoLayout *playout, GdkRectangle *t
{
GdkRectangle box_area;
+ cairo_save(cr);
+
gint extents = _gtk_cairo_blur_compute_pixels(blur_radius);
/* Extend even more the rectangle to not cut the shadows. */
@@ -2991,7 +2993,7 @@ xfdesktop_icon_view_draw_text(cairo_t *cr, PangoLayout *playout, GdkRectangle *t
cairo_move_to(cr,
box_area.x + extents + x_offset - rtl_offset,
box_area.y + extents + y_offset);
- cairo_save(cr);
+
if (blur_radius > 1) {
cr = gtk_css_shadow_value_start_drawing (cr, blur_radius);
@@ -3095,7 +3097,7 @@ xfdesktop_icon_view_paint_icon(XfdesktopIconView *icon_view,
}
/* draw text shadow for the label text if an offset was defined */
- if(x_offset || y_offset || icon_view->priv->shadow_blur_radius) {
+ if(x_offset || y_offset || (icon_view->priv->shadow_blur_radius > 1)) {
/* Draw the shadow */
xfdesktop_icon_view_draw_text(cr, playout,
&text_extents,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list