[maemo-commits] [maemo-commits] r12385 - in projects/haf/trunk/hildon-desktop: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jun 19 16:04:30 EEST 2007
Author: moimart
Date: 2007-06-19 16:04:28 +0300 (Tue, 19 Jun 2007)
New Revision: 12385

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/src/hd-switcher-menu-item.c
Log:
2007-06-19  Moises Martinez  <moises.martinez at nokia.com>

        * src/hd-switcher-menu-item.c: Fixed ellipsizing of labels.
	* ChangeLog updated.



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-19 12:48:49 UTC (rev 12384)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-19 13:04:28 UTC (rev 12385)
@@ -1,3 +1,7 @@
+2007-06-19  Moises Martinez  <moises.martinez at nokia.com>
+
+	* src/hd-switcher-menu-item.c: Fixed ellipsizing of labels.
+
 2007-06-19  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* src/hd-desktop.c: load newly installed plugins if the container is

Modified: projects/haf/trunk/hildon-desktop/src/hd-switcher-menu-item.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-switcher-menu-item.c	2007-06-19 12:48:49 UTC (rev 12384)
+++ projects/haf/trunk/hildon-desktop/src/hd-switcher-menu-item.c	2007-06-19 13:04:28 UTC (rev 12385)
@@ -484,10 +484,14 @@
   child_width = MAX (child_width, requisition->width);
   
   GTK_WIDGET_CLASS (hd_switcher_menu_item_parent_class)->size_request (widget,
-		 						  requisition);
-  if (child_width > AS_MENU_ITEM_WIDTH)
+		 						       requisition);
+
+  GtkWidget *parent = gtk_widget_get_parent (widget);
+  gint label_width_ellipsize = (parent) ? parent->requisition.width : AS_MENU_ITEM_WIDTH;
+
+  if (child_width > label_width_ellipsize)
   {
-    requisition->width = AS_MENU_ITEM_WIDTH;
+    requisition->width = label_width_ellipsize;
 
     gtk_label_set_ellipsize (GTK_LABEL (priv->label), PANGO_ELLIPSIZE_END);
     gtk_label_set_ellipsize (GTK_LABEL (priv->label2), PANGO_ELLIPSIZE_END);


More information about the maemo-commits mailing list