[gtk] infobar: Don't store close button visibility separately
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] infobar: Don't store close button visibility separately
- Date: Sat, 15 Feb 2020 16:24:28 +0000 (UTC)
commit a7de8e6b2f99a3aa98b214742b331ad518cdc26b
Author: Timm Bäder <mail baedert org>
Date: Fri Feb 14 18:06:39 2020 +0100
infobar: Don't store close button visibility separately
We can already set and query that value via
gtk_widget_{get,set}_visible() on the close button.
gtk/gtkinfobar.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 53ded51055..4cf7989292 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -163,7 +163,6 @@ typedef struct
GtkWidget *close_button;
GtkWidget *revealer;
- gboolean show_close_button;
GtkMessageType message_type;
int default_response;
gboolean default_response_sensitive;
@@ -1247,9 +1246,8 @@ gtk_info_bar_set_show_close_button (GtkInfoBar *info_bar,
g_return_if_fail (GTK_IS_INFO_BAR (info_bar));
- if (setting != priv->show_close_button)
+ if (setting != gtk_info_bar_get_show_close_button (info_bar))
{
- priv->show_close_button = setting;
gtk_widget_set_visible (priv->close_button, setting);
g_object_notify_by_pspec (G_OBJECT (info_bar), props[PROP_SHOW_CLOSE_BUTTON]);
}
@@ -1270,7 +1268,7 @@ gtk_info_bar_get_show_close_button (GtkInfoBar *info_bar)
g_return_val_if_fail (GTK_IS_INFO_BAR (info_bar), FALSE);
- return priv->show_close_button;
+ return gtk_widget_get_visible (priv->close_button);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]