diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-12-29 04:39:51 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-12-29 04:39:51 +0000 |
commit | b3ef93d8ee2139996d1a43b498a6314d5a2b2370 (patch) | |
tree | f0fbf498fcf648d9be05ea20dad8626726ccafe3 /gtk/gtkiconview.c | |
parent | a8604619bd5e268ecff6e8bd7bb4edef74c57c3e (diff) | |
download | gtk+-b3ef93d8ee2139996d1a43b498a6314d5a2b2370.tar.gz |
Use word wrapping by default, and center multiline labels. (#318763, Ross
2006-12-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconview.c: Use word wrapping by default, and
center multiline labels. (#318763, Ross Burton)
* gtk/gtkcellrenderertext.c (get_layout): Remove a special
case for single-line layouts.
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r-- | gtk/gtkiconview.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 4b028fc4e0..218e653f93 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -2659,6 +2659,7 @@ adjust_wrap_width (GtkIconView *icon_view, wrap_width = item->width - pixbuf_width - icon_view->priv->spacing; g_object_set (text_info->cell, "wrap-width", wrap_width, NULL); + g_object_set (text_info->cell, "width", wrap_width, NULL); } } @@ -4150,7 +4151,8 @@ gtk_icon_view_set_cell_data (GtkIconView *icon_view, GtkTreePath *path; path = gtk_tree_path_new_from_indices (item->index, -1); - gtk_tree_model_get_iter (icon_view->priv->model, &iter, path); + if (!gtk_tree_model_get_iter (icon_view->priv->model, &iter, path)) + return; gtk_tree_path_free (path); } else @@ -4826,14 +4828,16 @@ update_text_cell (GtkIconView *icon_view) if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL) g_object_set (info->cell, - "wrap-mode", PANGO_WRAP_CHAR, + "alignment", PANGO_ALIGN_CENTER, + "wrap-mode", PANGO_WRAP_WORD, "wrap-width", icon_view->priv->item_width, - "xalign", 0.5, + "xalign", 0.0, "yalign", 0.0, NULL); else g_object_set (info->cell, - "wrap-mode", PANGO_WRAP_CHAR, + "alignment", PANGO_ALIGN_LEFT, + "wrap-mode", PANGO_WRAP_WORD, "wrap-width", icon_view->priv->item_width, "xalign", 0.0, "yalign", 0.0, @@ -8852,10 +8856,10 @@ static AtkObject* gtk_icon_view_accessible_ref_selection (AtkSelection *selection, gint i) { + GList *l; GtkWidget *widget; GtkIconView *icon_view; GtkIconViewItem *item; - GList *l; widget = GTK_ACCESSIBLE (selection)->widget; if (widget == NULL) |