--- xfce-4.4.0/src/xfdesktop-4.4.0/src/xfdesktop-icon-view.c 2007-01-20 22:18:37.000000000 +0100 +++ xfce-4.4.0.patched/src/xfdesktop-4.4.0/src/xfdesktop-icon-view.c 2007-02-11 19:27:29.000000000 +0100 @@ -45,10 +45,10 @@ #define DEFAULT_ICON_SIZE 32 #define ICON_SIZE (icon_view->priv->icon_size) -#define TEXT_WIDTH ((ICON_SIZE << 1) + (ICON_SIZE >> 1)) /* aka 2.5x */ -#define CELL_PADDING 6 +#define TEXT_WIDTH ((icon_view->priv->cell_text_width_proportion) * ICON_SIZE) +#define CELL_PADDING (icon_view->priv->cell_padding) #define CELL_SIZE (TEXT_WIDTH + CELL_PADDING * 2) -#define SPACING 6 +#define SPACING (icon_view->priv->cell_spacing) #define SCREEN_MARGIN 8 #define CORNER_ROUNDNESS 4 @@ -144,6 +144,9 @@ GdkPixbuf *rounded_frame; gint label_alpha; + gint cell_padding; + gint cell_spacing; + gfloat cell_text_width_proportion; guint tip_show_id; gint tip_timeout; @@ -347,6 +350,28 @@ 0, 255, 155, G_PARAM_READABLE)); + gtk_widget_class_install_style_property(widget_class, + g_param_spec_int("cell-spacing", + "Cell spacing", + "Spacing between desktop icon cells", + 0, 255, 6, + G_PARAM_READABLE)); + + gtk_widget_class_install_style_property(widget_class, + g_param_spec_int("cell-padding", + "Cell padding", + "Padding in desktop icon cell", + 0, 255, 6, + G_PARAM_READABLE)); + + gtk_widget_class_install_style_property(widget_class, + g_param_spec_float("cell-text-width-proportion", + "Cell text width proportion", + "Width of text in desktop icon cell, " + "calculated as multiplier of the icon size", + 1.0, 10.0, 2.5, + G_PARAM_READABLE)); + xfdesktop_cell_highlight_quark = g_quark_from_static_string("xfdesktop-icon-view-cell-highlight"); } @@ -1316,6 +1341,18 @@ "label-alpha", &icon_view->priv->label_alpha, NULL); DBG("label alpha is %d", icon_view->priv->label_alpha); + gtk_widget_style_get(GTK_WIDGET(icon_view), + "cell-spacing", &icon_view->priv->cell_spacing, + NULL); + DBG("cell spacing is %d", icon_view->priv->cell_spacing); + gtk_widget_style_get(GTK_WIDGET(icon_view), + "cell-padding", &icon_view->priv->cell_padding, + NULL); + DBG("cell padding is %d", icon_view->priv->cell_padding); + gtk_widget_style_get(GTK_WIDGET(icon_view), + "cell-text-width-proportion", &icon_view->priv->cell_text_width_proportion, + NULL); + DBG("cell text width proportion is %f", icon_view->priv->cell_text_width_proportion); GTK_WIDGET_CLASS(xfdesktop_icon_view_parent_class)->style_set(widget, previous_style);