mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
Add nautilus_icon_canvas_item_invalidate_label(), which removes the
2008-09-12 Christian Neumair <cneumair@gnome.org> * libnautilus-private/nautilus-icon-canvas-item.c (nautilus_icon_canvas_item_set_is_visible), (nautilus_icon_canvas_item_invalidate_label): * libnautilus-private/nautilus-icon-canvas-item.h: * libnautilus-private/nautilus-icon-container.c (invalidate_labels), (nautilus_icon_container_set_layout_mode), (nautilus_icon_container_set_label_position), (nautilus_icon_container_set_font), (nautilus_icon_container_set_font_size_table), (nautilus_icon_container_set_all_columns_same_width): Add nautilus_icon_canvas_item_invalidate_label(), which removes the associated PangoLayout - used when resetting attributes, e.g. when the zoom level changes or when switching from “text below” to “text besides” mode. Fixes #551862. svn path=/trunk/; revision=14616
This commit is contained in:
parent
b60f861638
commit
59ecf171a5
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2008-09-12 Christian Neumair <cneumair@gnome.org>
|
||||
|
||||
* libnautilus-private/nautilus-icon-canvas-item.c
|
||||
(nautilus_icon_canvas_item_set_is_visible),
|
||||
(nautilus_icon_canvas_item_invalidate_label):
|
||||
* libnautilus-private/nautilus-icon-canvas-item.h:
|
||||
* libnautilus-private/nautilus-icon-container.c
|
||||
(invalidate_labels), (nautilus_icon_container_set_layout_mode),
|
||||
(nautilus_icon_container_set_label_position),
|
||||
(nautilus_icon_container_set_font),
|
||||
(nautilus_icon_container_set_font_size_table),
|
||||
(nautilus_icon_container_set_all_columns_same_width):
|
||||
Add nautilus_icon_canvas_item_invalidate_label(), which removes the
|
||||
associated PangoLayout - used when resetting attributes, e.g. when the
|
||||
zoom level changes or when switching from “text below” to “text
|
||||
besides” mode. Fixes #551862.
|
||||
|
||||
2008-09-12 Christian Neumair <cneumair@gnome.org>
|
||||
|
||||
* libnautilus-private/nautilus-directory.c
|
||||
|
|
|
@ -1427,18 +1427,28 @@ nautilus_icon_canvas_item_set_is_visible (NautilusIconCanvasItem *item,
|
|||
item->details->is_visible = visible;
|
||||
|
||||
if (!visible) {
|
||||
if (item->details->editable_text_layout) {
|
||||
g_object_unref (item->details->editable_text_layout);
|
||||
item->details->editable_text_layout = NULL;
|
||||
}
|
||||
if (item->details->additional_text_layout) {
|
||||
g_object_unref (item->details->additional_text_layout);
|
||||
item->details->additional_text_layout = NULL;
|
||||
}
|
||||
if (item->details->embedded_text_layout) {
|
||||
g_object_unref (item->details->embedded_text_layout);
|
||||
item->details->embedded_text_layout = NULL;
|
||||
}
|
||||
nautilus_icon_canvas_item_invalidate_label (item);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_icon_canvas_item_invalidate_label (NautilusIconCanvasItem *item)
|
||||
{
|
||||
nautilus_icon_canvas_item_invalidate_label_size (item);
|
||||
|
||||
if (item->details->editable_text_layout) {
|
||||
g_object_unref (item->details->editable_text_layout);
|
||||
item->details->editable_text_layout = NULL;
|
||||
}
|
||||
|
||||
if (item->details->additional_text_layout) {
|
||||
g_object_unref (item->details->additional_text_layout);
|
||||
item->details->additional_text_layout = NULL;
|
||||
}
|
||||
|
||||
if (item->details->embedded_text_layout) {
|
||||
g_object_unref (item->details->embedded_text_layout);
|
||||
item->details->embedded_text_layout = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ gboolean nautilus_icon_canvas_item_hit_test_rectangle (NautilusIconCanv
|
|||
gboolean nautilus_icon_canvas_item_hit_test_stretch_handles (NautilusIconCanvasItem *item,
|
||||
EelDPoint world_point,
|
||||
GtkCornerType *corner);
|
||||
void nautilus_icon_canvas_item_invalidate_label (NautilusIconCanvasItem *item);
|
||||
void nautilus_icon_canvas_item_invalidate_label_size (NautilusIconCanvasItem *item);
|
||||
EelDRect nautilus_icon_canvas_item_get_icon_rectangle (const NautilusIconCanvasItem *item);
|
||||
EelDRect nautilus_icon_canvas_item_get_text_rectangle (NautilusIconCanvasItem *item,
|
||||
|
|
|
@ -2294,6 +2294,20 @@ invalidate_label_sizes (NautilusIconContainer *container)
|
|||
}
|
||||
}
|
||||
|
||||
/* invalidate the entire labels (i.e. their attributes) for all the icons */
|
||||
static void
|
||||
invalidate_labels (NautilusIconContainer *container)
|
||||
{
|
||||
GList *p;
|
||||
NautilusIcon *icon;
|
||||
|
||||
for (p = container->details->icons; p != NULL; p = p->next) {
|
||||
icon = p->data;
|
||||
|
||||
nautilus_icon_canvas_item_invalidate_label (icon->item);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
select_range (NautilusIconContainer *container,
|
||||
NautilusIcon *icon1,
|
||||
|
@ -7985,7 +7999,7 @@ nautilus_icon_container_set_layout_mode (NautilusIconContainer *container,
|
|||
g_return_if_fail (NAUTILUS_IS_ICON_CONTAINER (container));
|
||||
|
||||
container->details->layout_mode = mode;
|
||||
invalidate_label_sizes (container);
|
||||
invalidate_labels (container);
|
||||
|
||||
redo_layout (container);
|
||||
|
||||
|
@ -8001,7 +8015,7 @@ nautilus_icon_container_set_label_position (NautilusIconContainer *container,
|
|||
if (container->details->label_position != position) {
|
||||
container->details->label_position = position;
|
||||
|
||||
invalidate_label_sizes (container);
|
||||
invalidate_labels (container);
|
||||
nautilus_icon_container_request_update_all (container);
|
||||
|
||||
schedule_redo_layout (container);
|
||||
|
@ -8715,7 +8729,7 @@ nautilus_icon_container_set_font (NautilusIconContainer *container,
|
|||
g_free (container->details->font);
|
||||
container->details->font = g_strdup (font);
|
||||
|
||||
invalidate_label_sizes (container);
|
||||
invalidate_labels (container);
|
||||
nautilus_icon_container_request_update_all (container);
|
||||
gtk_widget_queue_draw (GTK_WIDGET (container));
|
||||
}
|
||||
|
@ -8739,7 +8753,7 @@ nautilus_icon_container_set_font_size_table (NautilusIconContainer *container,
|
|||
}
|
||||
|
||||
if (old_font_size != container->details->font_size_table[container->details->zoom_level]) {
|
||||
invalidate_label_sizes (container);
|
||||
invalidate_labels (container);
|
||||
nautilus_icon_container_request_update_all (container);
|
||||
}
|
||||
}
|
||||
|
@ -8806,7 +8820,7 @@ nautilus_icon_container_set_all_columns_same_width (NautilusIconContainer *conta
|
|||
if (all_columns_same_width != container->details->all_columns_same_width) {
|
||||
container->details->all_columns_same_width = all_columns_same_width;
|
||||
|
||||
invalidate_label_sizes (container);
|
||||
invalidate_labels (container);
|
||||
nautilus_icon_container_request_update_all (container);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue