[gnome-control-center] shell: Set wrap mode to "word" for the icon text
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] shell: Set wrap mode to "word" for the icon text
- Date: Mon, 13 Dec 2010 14:04:00 +0000 (UTC)
commit e92fba97a786f72de89df7833d4738022c30cf60
Author: Bastien Nocera <hadess hadess net>
Date: Mon Dec 13 14:03:10 2010 +0000
shell: Set wrap mode to "word" for the icon text
https://bugzilla.gnome.org/show_bug.cgi?id=637035
shell/cc-shell-category-view.c | 1 +
shell/cc-shell-item-view.c | 20 ++++++++++++++++++++
shell/cc-shell-item-view.h | 2 ++
3 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/shell/cc-shell-category-view.c b/shell/cc-shell-category-view.c
index 6466c84..436e166 100644
--- a/shell/cc-shell-category-view.c
+++ b/shell/cc-shell-category-view.c
@@ -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)
diff --git a/shell/cc-shell-item-view.c b/shell/cc-shell-item-view.c
index a1cd9d7..7b0b37a 100644
--- a/shell/cc-shell-item-view.c
+++ b/shell/cc-shell-item-view.c
@@ -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)
{
diff --git a/shell/cc-shell-item-view.h b/shell/cc-shell-item-view.h
index ec27f14..777e819 100644
--- a/shell/cc-shell-item-view.h
+++ b/shell/cc-shell-item-view.h
@@ -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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]