shell: Set wrap mode to "word" for the icon text

https://bugzilla.gnome.org/show_bug.cgi?id=637035
This commit is contained in:
Bastien Nocera 2010-12-13 14:03:10 +00:00
parent 40d882da1c
commit e92fba97a7
3 changed files with 23 additions and 0 deletions

View file

@ -153,6 +153,7 @@ cc_shell_category_view_constructed (GObject *object)
gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (iconview), COL_PIXBUF);
gtk_icon_view_set_text_column (GTK_ICON_VIEW (iconview), COL_NAME);
gtk_icon_view_set_item_width (GTK_ICON_VIEW (iconview), 100);
cc_shell_item_view_update_cells (CC_SHELL_ITEM_VIEW (iconview));
/* create the header if required */
if (priv->name)

View file

@ -148,6 +148,26 @@ iconview_item_activated_cb (GtkIconView *icon_view,
g_free (id);
}
void
cc_shell_item_view_update_cells (CcShellItemView *view)
{
GList *cells, *l;
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (view));
for (l = cells ; l != NULL; l = l->next)
{
GtkCellRenderer *cell = l->data;
if (GTK_IS_CELL_RENDERER_TEXT (cell)) {
g_object_set (G_OBJECT (cell),
"wrap-mode", PANGO_WRAP_WORD,
NULL);
/* We only have one text cell */
break;
}
}
}
static void
cc_shell_item_view_class_init (CcShellItemViewClass *klass)
{

View file

@ -67,6 +67,8 @@ GType cc_shell_item_view_get_type (void) G_GNUC_CONST;
GtkWidget *cc_shell_item_view_new (void);
void cc_shell_item_view_update_cells (CcShellItemView *view);
G_END_DECLS
#endif /* _CC_SHELL_ITEM_VIEW_H */