[maemo-commits] [maemo-commits] r18847 - in projects/haf/trunk/hildon-control-panel: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jul 10 13:08:56 EEST 2009
Author: paradi
Date: 2009-07-10 13:08:53 +0300 (Fri, 10 Jul 2009)
New Revision: 18847

Modified:
   projects/haf/trunk/hildon-control-panel/ChangeLog
   projects/haf/trunk/hildon-control-panel/src/hcp-grid.c
Log:
Added ellipsize to applet titles.



Modified: projects/haf/trunk/hildon-control-panel/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-control-panel/ChangeLog	2009-07-09 06:18:29 UTC (rev 18846)
+++ projects/haf/trunk/hildon-control-panel/ChangeLog	2009-07-10 10:08:53 UTC (rev 18847)
@@ -1,3 +1,8 @@
+2009-07-09 Peter Aradi <peter.aradi at maemo.org>
+
+	Added ellipsize to text renderer. GtkIconView cannot truncate text
+	otherwise.
+
 2009-07-03 Peter Aradi <peter.aradi at maemo.org>
 
 	Reverted changes to old UI.

Modified: projects/haf/trunk/hildon-control-panel/src/hcp-grid.c
===================================================================
--- projects/haf/trunk/hildon-control-panel/src/hcp-grid.c	2009-07-09 06:18:29 UTC (rev 18846)
+++ projects/haf/trunk/hildon-control-panel/src/hcp-grid.c	2009-07-10 10:08:53 UTC (rev 18847)
@@ -159,6 +159,11 @@
   grid->priv->text_cell = gtk_cell_renderer_text_new ();
   gtk_cell_renderer_set_fixed_size (grid->priv->text_cell, 248,-1);
 
+  /* FIXME: it seems that text truncation only works with GtkLabel */
+  g_object_set (G_OBJECT(grid->priv->text_cell), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+
+  gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT(grid->priv->text_cell),1);
+
   gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (grid), 
 		  	      grid->priv->text_cell, 
 			      FALSE);
@@ -188,8 +193,8 @@
      based on HCPAppView width. */
   gtk_icon_view_set_item_width (GTK_ICON_VIEW (grid), 
 		  		HCP_GRID_ITEM_WIDTH);
- 
 }
+
 void
 hcp_grid_refresh_icons (HCPGrid* grid)
 {

More information about the maemo-commits mailing list