summaryrefslogtreecommitdiff
path: root/embed
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@redhat.com>2022-12-26 17:12:36 -0600
committerMarge Bot <marge-bot@gnome.org>2022-12-27 08:08:41 +0000
commit312ab91fb70079f4c45d4e6650104852840c51cd (patch)
tree3a8cf7c505ebd4fe50db0622c3663f395f0e3712 /embed
parent62a83a87d146a9e5f24f42ff8a98ab454026d99c (diff)
downloadepiphany-312ab91fb70079f4c45d4e6650104852840c51cd.tar.gz
Replace deprecated gtk_widget_show/hide
This also removes a few cases that are no longer needed now that widgets are visible by default. Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1233>
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c18
-rw-r--r--embed/ephy-search-entry.c4
-rw-r--r--embed/ephy-web-view.c11
3 files changed, 20 insertions, 13 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 590d5fc2e..4207682b5 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -161,11 +161,11 @@ ephy_embed_set_statusbar_label (EphyEmbed *embed,
ephy_floating_bar_set_primary_label (EPHY_FLOATING_BAR (embed->floating_bar), label);
if (label == NULL || label[0] == '\0') {
- gtk_widget_hide (embed->floating_bar);
+ gtk_widget_set_visible (embed->floating_bar, FALSE);
gtk_widget_set_halign (embed->floating_bar, GTK_ALIGN_START);
gtk_widget_remove_css_class (embed->floating_bar, "end");
} else
- gtk_widget_show (embed->floating_bar);
+ gtk_widget_set_visible (embed->floating_bar, TRUE);
}
static void
@@ -329,7 +329,7 @@ static gboolean
fullscreen_message_label_hide (EphyEmbed *embed)
{
if (embed->fullscreen_message_id) {
- gtk_widget_hide (embed->fullscreen_message_label);
+ gtk_widget_set_visible (embed->fullscreen_message_label, FALSE);
g_source_remove (embed->fullscreen_message_id);
embed->fullscreen_message_id = 0;
}
@@ -341,7 +341,7 @@ void
ephy_embed_entering_fullscreen (EphyEmbed *embed)
{
if (!g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN, EPHY_PREFS_LOCKDOWN_FULLSCREEN)) {
- gtk_widget_show (embed->fullscreen_message_label);
+ gtk_widget_set_visible (embed->fullscreen_message_label, TRUE);
g_clear_handle_id (&embed->fullscreen_message_id, g_source_remove);
embed->fullscreen_message_id = g_timeout_add_seconds (5,
@@ -591,7 +591,7 @@ status_message_notify_cb (EphyWebView *view,
static gboolean
clear_progress_cb (EphyEmbed *embed)
{
- gtk_widget_hide (embed->progress);
+ gtk_widget_set_visible (embed->progress, FALSE);
embed->clear_progress_source_id = 0;
return FALSE;
@@ -611,7 +611,7 @@ progress_update (EphyWebView *view,
uri = webkit_web_view_get_uri (embed->web_view);
if (!uri || g_str_has_prefix (uri, "ephy-about:") ||
g_str_has_prefix (uri, "about:")) {
- gtk_widget_hide (embed->progress);
+ gtk_widget_set_visible (embed->progress, FALSE);
return;
}
@@ -624,7 +624,7 @@ progress_update (EphyWebView *view,
embed);
g_source_set_name_by_id (embed->clear_progress_source_id, "[epiphany] clear_progress_cb");
} else
- gtk_widget_show (embed->progress);
+ gtk_widget_set_visible (embed->progress, TRUE);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (embed->progress),
(loading || progress == 1.0) ? progress : 0.0);
@@ -746,7 +746,7 @@ ephy_embed_constructed (GObject *object)
gtk_widget_set_halign (embed->fullscreen_message_label, GTK_ALIGN_CENTER);
gtk_widget_set_valign (embed->fullscreen_message_label, GTK_ALIGN_CENTER);
gtk_widget_set_can_target (embed->fullscreen_message_label, FALSE);
- gtk_widget_hide (embed->fullscreen_message_label);
+ gtk_widget_set_visible (embed->fullscreen_message_label, FALSE);
gtk_overlay_add_overlay (GTK_OVERLAY (embed->overlay), embed->fullscreen_message_label);
ephy_embed_set_fullscreen_message (embed, FALSE);
@@ -754,7 +754,7 @@ ephy_embed_constructed (GObject *object)
embed->floating_bar = ephy_floating_bar_new ();
gtk_widget_set_halign (embed->floating_bar, GTK_ALIGN_START);
gtk_widget_set_valign (embed->floating_bar, GTK_ALIGN_END);
- gtk_widget_hide (embed->floating_bar);
+ gtk_widget_set_visible (embed->floating_bar, FALSE);
gtk_overlay_add_overlay (GTK_OVERLAY (embed->overlay), embed->floating_bar);
diff --git a/embed/ephy-search-entry.c b/embed/ephy-search-entry.c
index d22ede5bb..b79ba7214 100644
--- a/embed/ephy-search-entry.c
+++ b/embed/ephy-search-entry.c
@@ -318,7 +318,7 @@ ephy_search_entry_init (EphySearchEntry *self)
"accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
"icon-name", "edit-clear-symbolic",
NULL);
- gtk_widget_hide (self->clear_icon);
+ gtk_widget_set_visible (self->clear_icon, FALSE);
gtk_widget_set_parent (self->clear_icon, GTK_WIDGET (self));
gesture = gtk_gesture_click_new ();
@@ -330,7 +330,7 @@ ephy_search_entry_init (EphySearchEntry *self)
self->matches_label = gtk_label_new (NULL);
gtk_widget_add_css_class (self->matches_label, "dim-label");
gtk_widget_add_css_class (self->matches_label, "numeric");
- gtk_widget_hide (self->matches_label);
+ gtk_widget_set_visible (self->matches_label, FALSE);
gtk_widget_set_parent (self->matches_label, GTK_WIDGET (self));
gtk_editable_init_delegate (GTK_EDITABLE (self));
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 1372dc3f0..c5f2d95d6 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -511,7 +511,7 @@ ephy_web_view_show_auth_form_save_request (EphyWebView *web_
G_CALLBACK (info_bar_save_request_response_cb),
data, (GClosureNotify)save_auth_request_destroy, 0);
- gtk_widget_show (info_bar);
+ gtk_widget_set_visible (info_bar, TRUE);
}
static void
@@ -666,6 +666,13 @@ icon_changed_cb (EphyWebView *view,
}
static void
+password_form_info_bar_response_cb (GtkInfoBar *info_bar,
+ gint response_id)
+{
+ gtk_widget_set_visible (GTK_WIDGET (info_bar), FALSE);
+}
+
+static void
password_form_focused_cb (EphyEmbedShell *shell,
guint64 page_id,
gboolean insecure_form_action,
@@ -691,7 +698,7 @@ password_form_focused_cb (EphyEmbedShell *shell,
gtk_info_bar_set_show_close_button (GTK_INFO_BAR (info_bar), TRUE);
gtk_info_bar_add_child (GTK_INFO_BAR (info_bar), label);
- g_signal_connect (info_bar, "response", G_CALLBACK (gtk_widget_hide), NULL);
+ g_signal_connect (info_bar, "response", G_CALLBACK (password_form_info_bar_response_cb), NULL);
track_info_bar (info_bar, &web_view->password_form_info_bar);