[gtk/wip/baedert/for-master: 18/34] aboutdialog: Use new GtkStackPage API
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 18/34] aboutdialog: Use new GtkStackPage API
- Date: Thu, 20 Feb 2020 09:24:17 +0000 (UTC)
commit b5d4815eb7ac9003bb9cc4a637d32d8656f63cf9
Author: Timm Bäder <mail baedert org>
Date: Tue Feb 18 09:31:32 2020 +0100
aboutdialog: Use new GtkStackPage API
gtk/gtkaboutdialog.c | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index dd16a1104b..65e174e849 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -645,20 +645,14 @@ update_stack_switcher_visibility (GtkAboutDialog *about)
{
GtkAboutDialogPrivate *priv = gtk_about_dialog_get_instance_private (about);
GtkStackPage *page;
- gboolean visible;
- gboolean any_visible;
+ gboolean any_visible = FALSE;
- any_visible = FALSE;
-
page = gtk_stack_get_page (GTK_STACK (priv->stack), priv->credits_page);
- g_object_get (page, "visible", &visible, NULL);
- any_visible |= visible;
+ any_visible |= gtk_stack_page_get_visible (page);
page = gtk_stack_get_page (GTK_STACK (priv->stack), priv->license_page);
- g_object_get (page, "visible", &visible, NULL);
- any_visible |= visible;
+ any_visible |= gtk_stack_page_get_visible (page);
page = gtk_stack_get_page (GTK_STACK (priv->stack), priv->system_page);
- g_object_get (page, "visible", &visible, NULL);
- any_visible |= visible;
+ any_visible |= gtk_stack_page_get_visible (page);
gtk_widget_set_visible (priv->stack_switcher, any_visible);
}
@@ -670,11 +664,10 @@ update_license_button_visibility (GtkAboutDialog *about)
GtkStackPage *page;
page = gtk_stack_get_page (GTK_STACK (priv->stack), priv->license_page);
- g_object_set (page, "visible",
- priv->license_type == GTK_LICENSE_CUSTOM &&
- priv->license != NULL &&
- priv->license[0] != '\0',
- NULL);
+ gtk_stack_page_set_visible (page,
+ priv->license_type == GTK_LICENSE_CUSTOM &&
+ priv->license != NULL &&
+ priv->license[0] != '\0');
update_stack_switcher_visibility (about);
}
@@ -686,10 +679,9 @@ update_system_button_visibility (GtkAboutDialog *about)
GtkStackPage *page;
page = gtk_stack_get_page (GTK_STACK (priv->stack), priv->system_page);
- g_object_set (page, "visible",
- priv->system_information != NULL &&
- priv->system_information[0] != '\0',
- NULL);
+ gtk_stack_page_set_visible (page,
+ priv->system_information != NULL &&
+ priv->system_information[0] != '\0');
update_stack_switcher_visibility (about);
}
@@ -710,7 +702,7 @@ update_credits_button_visibility (GtkAboutDialog *about)
(priv->translator_credits != NULL &&
strcmp (priv->translator_credits, "translator_credits") &&
strcmp (priv->translator_credits, "translator-credits")));
- g_object_set (page, "visible", show, NULL);
+ gtk_stack_page_set_visible (page, show);
update_stack_switcher_visibility (about);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]