2006-10-19 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 19 Oct 2006 13:51:36 +0000 (13:51 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 19 Oct 2006 13:51:36 +0000 (13:51 +0000)
* hildon-widgets/hildon-banner.c:
(force_to_wrap_truncated): Set label size request to its natural
size (it stands fixed after it's wrapped). Fixes NB#38598.

ChangeLog
hildon-widgets/hildon-banner.c

index 59dc5ca..85ee04f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-19  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
+       * hildon-widgets/hildon-banner.c:
+       (force_to_wrap_truncated): Set label size request to its natural 
+       size (it stands fixed after it's wrapped). Fixes NB#38598.
+
 2006-10-18  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
        [0.14.6-1 release]
index 5291f80..1b267d8 100644 (file)
@@ -410,6 +410,7 @@ static void force_to_wrap_truncated(HildonBanner *banner){
   GtkLabel *label;
   PangoLayout *layout;
   int width_text, width_max;
+  int width = -1;
 
   label = GTK_LABEL(banner->priv->label);
 
@@ -427,9 +428,12 @@ static void force_to_wrap_truncated(HildonBanner *banner){
     pango_layout_set_width (layout, width_max * PANGO_SCALE);
     pango_layout_get_extents (layout, NULL, &logical);
 
-    gtk_widget_set_size_request (GTK_WIDGET (label),
-                                 PANGO_PIXELS (logical.width), -1);
+    width = PANGO_PIXELS (logical.width);
   }
+
+  /* use fixed width when wrapping or natural one otherwise */
+  gtk_widget_set_size_request (GTK_WIDGET (label),
+                              width, -1);
 }