Commit d449c072 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Draw drop shadows if use_drop_shadows.

2002-05-31  Alex Larsson <alexl@redhat.com>

	* libnautilus-private/nautilus-icon-canvas-item.c:
	Draw drop shadows if use_drop_shadows.

	* libnautilus-private/nautilus-icon-container.c:
	Implement nautilus_icon_container_set_use_drop_shadows.
	Use light color for labels if use_drop_shadows.

	* libnautilus-private/nautilus-icon-container.h:
	Add new function nautilus_icon_container_set_use_drop_shadows.

	* libnautilus-private/nautilus-icon-private.h:
	Add use_grop_shadow variable.

	* src/file-manager/fm-desktop-icon-view.c:
	Call nautilus_icon_container_set_use_drop_shadows()
parent f090e1eb
2002-05-31 Alex Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-canvas-item.c:
Draw drop shadows if use_drop_shadows.
* libnautilus-private/nautilus-icon-container.c:
Implement nautilus_icon_container_set_use_drop_shadows.
Use light color for labels if use_drop_shadows.
* libnautilus-private/nautilus-icon-container.h:
Add new function nautilus_icon_container_set_use_drop_shadows.
* libnautilus-private/nautilus-icon-private.h:
Add use_grop_shadow variable.
* src/file-manager/fm-desktop-icon-view.c:
Call nautilus_icon_container_set_use_drop_shadows()
2002-05-31 Damon Chaplin <damon@ximian.com>
* src/nautilus-application.c
......
......@@ -170,6 +170,7 @@ static void draw_label_layout (NautilusIconCanvasItem
GdkDrawable *drawable,
PangoLayout *layout,
gboolean highlight,
GdkColor *label_color,
int x,
int y,
GdkGC *gc);
......@@ -701,6 +702,7 @@ draw_or_measure_label_text (NautilusIconCanvasItem *item,
draw_label_layout (item, drawable,
layout, needs_highlight,
label_color,
icon_left + (icon_width - max_text_width) / 2,
icon_bottom, gc);
}
......@@ -725,6 +727,7 @@ draw_or_measure_label_text (NautilusIconCanvasItem *item,
draw_label_layout (item, drawable,
layout, needs_highlight,
label_color,
icon_left + (icon_width - max_text_width) / 2,
icon_bottom + height_so_far, gc);
}
......@@ -1212,6 +1215,7 @@ draw_label_layout (NautilusIconCanvasItem *item,
GdkDrawable *drawable,
PangoLayout *layout,
gboolean highlight,
GdkColor *label_color,
int x,
int y,
GdkGC *gc)
......@@ -1225,9 +1229,18 @@ draw_label_layout (NautilusIconCanvasItem *item,
}
if (!highlight || !antialias_selection_rectangle) {
gdk_draw_layout (drawable, gc,
x, y,
layout);
if (NAUTILUS_ICON_CONTAINER (GNOME_CANVAS_ITEM (item)->canvas)->details->use_drop_shadows) {
/* draw a drop shadow */
eel_gdk_draw_layout_with_drop_shadow (drawable, gc,
label_color,
&GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas)->style->black,
x, y,
layout);
} else {
gdk_draw_layout (drawable, gc,
x, y,
layout);
}
} else {
/* draw a shadow in black */
gdk_draw_layout (drawable,
......
......@@ -5095,7 +5095,7 @@ update_label_color (EelBackground *background,
container->details->label_color_highlight = eel_gdk_rgb_to_color (0xFFFFFF);
container->details->label_info_color_highlight = eel_gdk_rgb_to_color (0xCCCCCC);
if (eel_background_is_dark (background)) {
if (eel_background_is_dark (background) || container->details->use_drop_shadows) {
container->details->label_color = eel_gdk_rgb_to_color (0xEFEFEF);
container->details->label_info_color = eel_gdk_rgb_to_color (light_info_value);
} else { /* converse */
......@@ -5142,6 +5142,18 @@ nautilus_icon_container_set_margins (NautilusIconContainer *container,
schedule_redo_layout (container);
}
void
nautilus_icon_container_set_use_drop_shadows (NautilusIconContainer *container,
gboolean use_drop_shadows)
{
if (container->details->use_drop_shadows == use_drop_shadows) {
return;
}
container->details->use_drop_shadows = use_drop_shadows;
gtk_widget_queue_draw (GTK_WIDGET (container));
}
/* handle theme changes */
/* FIXME: The code to extract colors from the theme should be in FMDirectoryView, not here.
......
......@@ -236,5 +236,6 @@ void nautilus_icon_container_set_margins (Nautilu
int right_margin,
int top_margin,
int bottom_margin);
void nautilus_icon_container_set_use_drop_shadows (NautilusIconContainer *container,
gboolean use_drop_shadows);
#endif /* NAUTILUS_ICON_CONTAINER_H */
......@@ -215,6 +215,9 @@ struct NautilusIconContainerDetails {
int right_margin;
int top_margin;
int bottom_margin;
/* Whether we should use drop shadows for the icon labels or not */
gboolean use_drop_shadows;
};
/* Private functions shared by mutiple files. */
......
......@@ -607,6 +607,7 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
icon_container = get_icon_container (desktop_icon_view);
nautilus_icon_container_set_use_drop_shadows (icon_container, TRUE);
fm_icon_container_set_sort_desktop (FM_ICON_CONTAINER (icon_container), TRUE);
/* Set up details */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment