[libgd] stack-switcher: Show the buttons only if there is a title or an icon
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] stack-switcher: Show the buttons only if there is a title or an icon
- Date: Mon, 25 Mar 2013 15:00:40 +0000 (UTC)
commit 801ddd1edd4c88f07468938bd6166e3b2a433730
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Mar 25 01:36:25 2013 +0100
stack-switcher: Show the buttons only if there is a title or an icon
This makes it possible to have "internal" children in GdStack, which
the user is not supposed to know about. eg., a spinner which is only
supposed to be programmatically shown and hidden.
https://bugzilla.gnome.org/show_bug.cgi?id=696529
libgd/gd-stack-switcher.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libgd/gd-stack-switcher.c b/libgd/gd-stack-switcher.c
index 9389ef5..df31279 100644
--- a/libgd/gd-stack-switcher.c
+++ b/libgd/gd-stack-switcher.c
@@ -87,6 +87,8 @@ update_button (GdStackSwitcher *self,
gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (button), symbolic_icon_name);
gd_header_button_set_label (GD_HEADER_BUTTON (button), title);
+ gtk_widget_set_visible (button, title != NULL || symbolic_icon_name != NULL);
+
if (symbolic_icon_name != NULL)
gtk_widget_set_size_request (button, -1, -1);
else
@@ -144,7 +146,6 @@ add_child (GdStackSwitcher *self,
}
gtk_container_add (GTK_CONTAINER (self), button);
- gtk_widget_show (button);
g_object_set_data (G_OBJECT (button), "stack-child", widget);
g_signal_connect (button, "clicked", G_CALLBACK (on_button_clicked), self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]