aboutsummaryrefslogtreecommitdiff
path: root/hildon/hildon-banner.c
diff options
context:
space:
mode:
authorXabier Rodriguez Calvar <xrcalvar@igalia.com>2010-02-23 10:02:47 +0100
committerXabier Rodriguez Calvar <xrcalvar@igalia.com>2010-02-23 11:56:34 +0100
commit3fa015497ee2cc280976c87e93e23435526e6e80 (patch)
treeec61dea227f6571fda99f5a2d4658f157073ee8c /hildon/hildon-banner.c
parentafb8f0ba7200bc62c8da695354c76dc39350de94 (diff)
Remove main item and repack label for progress and information banners
Doing it in _set_text was causing a problem with information banner, which ended up not having the animation widget. Fixes: NB#156325
Diffstat (limited to 'hildon/hildon-banner.c')
-rw-r--r--hildon/hildon-banner.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/hildon/hildon-banner.c b/hildon/hildon-banner.c
index eb95349..fd8eaca 100644
--- a/hildon/hildon-banner.c
+++ b/hildon/hildon-banner.c
@@ -617,13 +617,6 @@ banner_do_set_text (HildonBanner *banner,
priv = HILDON_BANNER_GET_PRIVATE (banner);
- if (priv->main_item) {
- gtk_container_remove (GTK_CONTAINER (priv->layout), priv->main_item);
- priv->main_item = NULL;
- gtk_box_pack_start (GTK_BOX (priv->layout), priv->label, FALSE, FALSE,
- 0);
- }
-
if (is_markup) {
gtk_label_set_markup (GTK_LABEL (priv->label), text);
} else {
@@ -972,6 +965,21 @@ reshow_banner (HildonBanner *banner)
gtk_widget_show_all (GTK_WIDGET (banner));
}
+static void
+unpack_main_widget_pack_label (HildonBanner *banner)
+{
+ HildonBannerPrivate *priv = NULL;
+
+ priv = HILDON_BANNER_GET_PRIVATE (banner);
+
+ if (priv->main_item) {
+ gtk_container_remove (GTK_CONTAINER (priv->layout), priv->main_item);
+ priv->main_item = NULL;
+ gtk_box_pack_start (GTK_BOX (priv->layout), priv->label, FALSE, FALSE,
+ 0);
+ }
+}
+
static GtkWidget*
hildon_banner_real_show_information (GtkWidget *widget,
const gchar *text,
@@ -987,6 +995,7 @@ hildon_banner_real_show_information (GtkWidget *widget,
priv = HILDON_BANNER_GET_PRIVATE (banner);
priv->name_suffix = "information";
+ unpack_main_widget_pack_label (banner);
banner_do_set_text (banner, text, FALSE);
hildon_banner_bind_style (banner);
@@ -1177,6 +1186,7 @@ hildon_banner_show_progress (GtkWidget *widget,
g_assert (priv);
priv->name_suffix = "progress";
+ unpack_main_widget_pack_label (banner);
banner_do_set_text (banner, text, FALSE);
hildon_banner_bind_style (banner);