* hildon-widgets/hildon-banner.c (hildon_banner_set_property): Set max_width hint...
authorLuc Pionchon <luc.pionchon@nokia.com>
Sun, 28 May 2006 22:38:15 +0000 (22:38 +0000)
committerLuc Pionchon <luc.pionchon@nokia.com>
Sun, 28 May 2006 22:38:15 +0000 (22:38 +0000)
(hildon_banner_set_text): Removed useless gtk_window_resize after
        changing the label text. The size requisition of the banner is
        updated when the label text is modified, so there is no need to do
        a resize of the window to the requisition size.
        (hildon_banner_set_markup): Likewise.

        (hildon_banner_check_position): Added cast to widget argument in
        call to force_to_wrap_truncated in order to avoid a compilation
        warning.

ChangeLog
hildon-widgets/hildon-banner.c

index a536fc4..a69f9b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2006-05-29  Luc Pionchon  <luc.pionchon@nokia.com>
 
+       * hildon-widgets/hildon-banner.c
+       (hildon_banner_set_property): Set max_width hint to -1 instead of
+       HILDON_BANNER_LABEL_MAX_TIMED when banner is timed to avoid. This
+       has been done to ensure that the size of the banner will be the
+       requisition size and avoid the size problem when reusing the
+       banner window. See NB#24339.
+
+       (hildon_banner_set_text): Removed useless gtk_window_resize after
+       changing the label text. The size requisition of the banner is
+       updated when the label text is modified, so there is no need to do
+       a resize of the window to the requisition size.
+       (hildon_banner_set_markup): Likewise.
+       
+       (hildon_banner_check_position): Added cast to widget argument in
+       call to force_to_wrap_truncated in order to avoid a compilation
+       warning.
+
+2006-05-29  Luc Pionchon  <luc.pionchon@nokia.com>
+
         Added time-error signal - NB#22155
        
        * hildon-widgets/hildon-time-editor.c:
index e689f74..77e120b 100644 (file)
@@ -237,8 +237,11 @@ static void hildon_banner_set_property(GObject      *object,
          priv->is_timed = g_value_get_boolean(value);
 
          /* Timed and progress notifications have different
-            pixel size values for text */
-         geom.max_width = priv->is_timed ? HILDON_BANNER_LABEL_MAX_TIMED
+            pixel size values for text. 
+            We force to use requisition size for timed banners 
+            in order to avoid resize problems when reusing the
+            window (see bug #24339) */
+         geom.max_width = priv->is_timed ? -1
                                          : HILDON_BANNER_LABEL_MAX_PROGRESS;
          geom.max_height = -1;
          gtk_window_set_geometry_hints(GTK_WINDOW(object), 
@@ -429,7 +432,7 @@ static void hildon_banner_check_position(GtkWidget *widget)
    gint x, y;
    GtkRequisition req;
 
-   force_to_wrap_truncated(widget); /* see N#27000 and G#329646 */
+   force_to_wrap_truncated(HILDON_BANNER(widget)); /* see N#27000 and G#329646 */
 
    gtk_widget_size_request(widget, &req);
 
@@ -767,20 +770,12 @@ GtkWidget *hildon_banner_show_progress(GtkWidget *widget,
 void hildon_banner_set_text(HildonBanner *self, const gchar *text)
 {
    GtkLabel *label;
-   GtkRequisition req;
 
    g_return_if_fail(HILDON_IS_BANNER(self));
 
    label = GTK_LABEL(self->priv->label);
    gtk_label_set_text(label, text);
 
-   /* A re-used window may be too large, shrink to the requisition size */
-   gtk_widget_size_request(GTK_WIDGET(self), &req);
-   if (req.width != 0)
-   {
-     gtk_window_resize(GTK_WINDOW(self), req.width, req.height);
-   }
-
    hildon_banner_check_position(GTK_WIDGET(self));
 }
 
@@ -796,20 +791,12 @@ void hildon_banner_set_text(HildonBanner *self, const gchar *text)
 void hildon_banner_set_markup(HildonBanner *self, const gchar *markup)
 {
    GtkLabel *label;
-   GtkRequisition req;
 
    g_return_if_fail(HILDON_IS_BANNER(self));
 
    label = GTK_LABEL(self->priv->label);
    gtk_label_set_markup(label, markup);
 
-   /* A re-used window may be too large, shrink to the requisition size */
-   gtk_widget_size_request(GTK_WIDGET(self), &req);
-   if (req.width != 0)
-   {
-     gtk_window_resize(GTK_WINDOW(self), req.width, req.height);
-   }
-
    hildon_banner_check_position(GTK_WIDGET(self));
 }