[libdazzle] preferences: hide all subpages when changing pages
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] preferences: hide all subpages when changing pages
- Date: Fri, 9 Aug 2019 02:48:28 +0000 (UTC)
commit 28eff52a2ab77ca0b0e62e071dd04e70eacd2db1
Author: Christian Hergert <chergert redhat com>
Date: Thu Aug 8 19:48:24 2019 -0700
preferences: hide all subpages when changing pages
This is useful so that if there are no visible widgets in the sub-page,
we don't show another subpage instead.
src/prefs/dzl-preferences-view.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/src/prefs/dzl-preferences-view.c b/src/prefs/dzl-preferences-view.c
index 51cb746..3ee764a 100644
--- a/src/prefs/dzl-preferences-view.c
+++ b/src/prefs/dzl-preferences-view.c
@@ -454,6 +454,7 @@ dzl_preferences_view_add_page (DzlPreferences *preferences,
return;
page = g_object_new (DZL_TYPE_PREFERENCES_PAGE,
+ "name", page_name,
"priority", priority,
"visible", TRUE,
NULL);
@@ -994,8 +995,12 @@ dzl_preferences_view_set_page (DzlPreferences *preferences,
if (strchr (page_name, '.') != NULL)
{
+ gtk_container_foreach (GTK_CONTAINER (priv->subpage_stack),
+ (GtkCallback)gtk_widget_hide,
+ NULL);
dzl_preferences_page_set_map (DZL_PREFERENCES_PAGE (page), map);
gtk_stack_set_visible_child (priv->subpage_stack, page);
+ gtk_widget_show (page);
gtk_widget_show (GTK_WIDGET (priv->subpage_stack));
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]