diff options
author | Michael Catanzaro <mcatanzaro@redhat.com> | 2022-12-26 17:12:36 -0600 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2022-12-27 08:08:41 +0000 |
commit | 312ab91fb70079f4c45d4e6650104852840c51cd (patch) | |
tree | 3a8cf7c505ebd4fe50db0622c3663f395f0e3712 | |
parent | 62a83a87d146a9e5f24f42ff8a98ab454026d99c (diff) | |
download | epiphany-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>
-rw-r--r-- | embed/ephy-embed.c | 18 | ||||
-rw-r--r-- | embed/ephy-search-entry.c | 4 | ||||
-rw-r--r-- | embed/ephy-web-view.c | 11 | ||||
-rw-r--r-- | lib/ephy-notification-container.c | 6 | ||||
-rw-r--r-- | src/ephy-action-bar.c | 2 | ||||
-rw-r--r-- | src/ephy-certificate-dialog.c | 6 | ||||
-rw-r--r-- | src/ephy-download-widget.c | 11 | ||||
-rw-r--r-- | src/ephy-downloads-popover.c | 4 | ||||
-rw-r--r-- | src/ephy-encoding-dialog.c | 4 | ||||
-rw-r--r-- | src/ephy-encoding-row.c | 5 | ||||
-rw-r--r-- | src/ephy-firefox-sync-dialog.c | 18 | ||||
-rw-r--r-- | src/ephy-header-bar.c | 2 | ||||
-rw-r--r-- | src/ephy-history-dialog.c | 2 | ||||
-rw-r--r-- | src/ephy-location-entry.c | 6 | ||||
-rw-r--r-- | src/ephy-security-popover.c | 1 | ||||
-rw-r--r-- | src/ephy-session.c | 2 | ||||
-rw-r--r-- | src/ephy-shell.c | 5 | ||||
-rw-r--r-- | src/ephy-window.c | 11 | ||||
-rw-r--r-- | src/preferences/extension-view.c | 4 | ||||
-rw-r--r-- | src/preferences/passwords-view.c | 4 | ||||
-rw-r--r-- | src/preferences/prefs-general-page.c | 2 | ||||
-rw-r--r-- | src/webextension/ephy-web-extension-manager.c | 4 | ||||
-rw-r--r-- | src/window-commands.c | 2 |
23 files changed, 65 insertions, 69 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); diff --git a/lib/ephy-notification-container.c b/lib/ephy-notification-container.c index 8a02322f2..52322de35 100644 --- a/lib/ephy-notification-container.c +++ b/lib/ephy-notification-container.c @@ -51,7 +51,7 @@ ephy_notification_container_init (EphyNotificationContainer *self) self->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_revealer_set_child (GTK_REVEALER (self->revealer), self->box); - gtk_widget_hide (GTK_WIDGET (self)); + gtk_widget_set_visible (GTK_WIDGET (self), FALSE); } static void @@ -76,7 +76,7 @@ notification_close_cb (EphyNotification *notification, gtk_box_remove (GTK_BOX (self->box), GTK_WIDGET (notification)); if (!gtk_widget_get_first_child (self->box)) { - gtk_widget_hide (GTK_WIDGET (self)); + gtk_widget_set_visible (GTK_WIDGET (self), FALSE); gtk_revealer_set_reveal_child (GTK_REVEALER (self->revealer), FALSE); } } @@ -102,7 +102,7 @@ ephy_notification_container_add_notification (EphyNotificationContainer *self, } gtk_box_append (GTK_BOX (self->box), notification); - gtk_widget_show (GTK_WIDGET (self)); + gtk_widget_set_visible (GTK_WIDGET (self), TRUE); gtk_revealer_set_reveal_child (GTK_REVEALER (self->revealer), TRUE); g_signal_connect (notification, "close", G_CALLBACK (notification_close_cb), self); diff --git a/src/ephy-action-bar.c b/src/ephy-action-bar.c index a381a8756..5f5c56d59 100644 --- a/src/ephy-action-bar.c +++ b/src/ephy-action-bar.c @@ -70,7 +70,7 @@ update_revealer (EphyActionBar *action_bar) (action_bar->adaptive_mode == EPHY_ADAPTIVE_MODE_NARROW); if (reveal) - gtk_widget_show (GTK_WIDGET (action_bar)); + gtk_widget_set_visible (GTK_WIDGET (action_bar), TRUE); gtk_revealer_set_reveal_child (action_bar->revealer, reveal); } diff --git a/src/ephy-certificate-dialog.c b/src/ephy-certificate-dialog.c index 4f1f116a1..adb54328d 100644 --- a/src/ephy-certificate-dialog.c +++ b/src/ephy-certificate-dialog.c @@ -181,8 +181,8 @@ static void reveal_clicked_cb (GtkWidget *button, GtkWidget *secondary_info) { - gtk_widget_hide (button); - gtk_widget_show (secondary_info); + gtk_widget_set_visible (button, FALSE); + gtk_widget_set_visible (secondary_info, TRUE); } static GtkWidget * @@ -202,7 +202,7 @@ create_page (GcrCertificate *certificate) gtk_box_append (GTK_BOX (box), reveal_button); secondary_info = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - gtk_widget_hide (secondary_info); + gtk_widget_set_visible (secondary_info, FALSE); gtk_box_append (GTK_BOX (box), secondary_info); size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); diff --git a/src/ephy-download-widget.c b/src/ephy-download-widget.c index ee9e13499..9d4e46ff0 100644 --- a/src/ephy-download-widget.c +++ b/src/ephy-download-widget.c @@ -209,7 +209,7 @@ static void download_finished_cb (EphyDownload *download, EphyDownloadWidget *widget) { - gtk_widget_hide (widget->progress); + gtk_widget_set_visible (widget->progress, FALSE); update_status_label (widget, _("Finished")); gtk_button_set_icon_name (GTK_BUTTON (widget->action_button), "folder-open-symbolic"); @@ -232,7 +232,7 @@ download_failed_cb (EphyDownload *download, g_signal_handlers_disconnect_by_func (download, download_progress_cb, widget); - gtk_widget_hide (widget->progress); + gtk_widget_set_visible (widget->progress, FALSE); error_msg = g_strdup_printf (_("Error downloading: %s"), error->message); update_status_label (widget, error_msg); @@ -367,14 +367,13 @@ ephy_download_widget_constructed (GObject *object) G_OBJECT_CLASS (ephy_download_widget_parent_class)->constructed (object); grid = gtk_grid_new (); - gtk_widget_show (grid); + gtk_widget_set_visible (grid, TRUE); adw_bin_set_child (ADW_BIN (widget), grid); widget->icon = gtk_image_new (); gtk_widget_set_margin_end (widget->icon, 4); update_download_icon (widget); gtk_grid_attach (GTK_GRID (grid), widget->icon, 0, 0, 1, 1); - gtk_widget_show (widget->icon); widget->filename = gtk_label_new (NULL); gtk_widget_set_hexpand (widget->filename, true); @@ -383,15 +382,12 @@ ephy_download_widget_constructed (GObject *object) gtk_label_set_ellipsize (GTK_LABEL (widget->filename), PANGO_ELLIPSIZE_END); update_download_destination (widget); gtk_grid_attach (GTK_GRID (grid), widget->filename, 1, 0, 1, 1); - gtk_widget_show (widget->filename); widget->progress = gtk_progress_bar_new (); gtk_widget_set_margin_top (widget->progress, 6); gtk_widget_set_margin_bottom (widget->progress, 6); gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (widget->progress), 0.05); gtk_grid_attach (GTK_GRID (grid), widget->progress, 0, 1, 2, 1); - if (ephy_download_is_active (widget->download)) - gtk_widget_show (widget->progress); widget->status = gtk_label_new (NULL); gtk_label_set_xalign (GTK_LABEL (widget->status), 0); @@ -414,7 +410,6 @@ ephy_download_widget_constructed (GObject *object) update_status_label (widget, _("Starting…")); } gtk_grid_attach (GTK_GRID (grid), widget->status, 0, 2, 2, 1); - gtk_widget_show (widget->status); if (ephy_download_succeeded (widget->download)) action_icon_name = "folder-open-symbolic"; diff --git a/src/ephy-downloads-popover.c b/src/ephy-downloads-popover.c index 3e4296986..632131897 100644 --- a/src/ephy-downloads-popover.c +++ b/src/ephy-downloads-popover.c @@ -99,7 +99,7 @@ download_removed_cb (EphyDownloadsPopover *popover, /* Hide the popover before removing the last download widget so it "crumples" * more smoothly */ if (!gtk_list_box_get_row_at_index (GTK_LIST_BOX (popover->downloads_box), 2)) - gtk_widget_hide (GTK_WIDGET (popover)); + gtk_widget_set_visible (GTK_WIDGET (popover), FALSE); while ((row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (popover->downloads_box), i++))) { GtkWidget *widget = gtk_list_box_row_get_child (row); @@ -123,7 +123,7 @@ clear_button_clicked_cb (EphyDownloadsPopover *popover) GtkListBoxRow *row; int i = 0; - gtk_widget_hide (GTK_WIDGET (popover)); + gtk_widget_set_visible (GTK_WIDGET (popover), FALSE); manager = ephy_embed_shell_get_downloads_manager (ephy_embed_shell_get_default ()); g_signal_handlers_block_by_func (manager, download_removed_cb, popover); diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c index 3a7d2314a..5953dc282 100644 --- a/src/ephy-encoding-dialog.c +++ b/src/ephy-encoding-dialog.c @@ -384,7 +384,7 @@ ephy_encoding_dialog_constructed (GObject *object) recent = g_list_sort (recent, (GCompareFunc)sort_encodings); g_list_foreach (recent, (GFunc)add_list_item, dialog->recent_list_box); } else - gtk_widget_hide (dialog->recent_box); + gtk_widget_set_visible (dialog->recent_box, FALSE); /* related */ if (dialog->selected_encoding != NULL) { @@ -398,7 +398,7 @@ ephy_encoding_dialog_constructed (GObject *object) related = g_list_sort (related, (GCompareFunc)sort_encodings); g_list_foreach (related, (GFunc)add_list_item, dialog->related_list_box); } else - gtk_widget_hide (dialog->related_box); + gtk_widget_set_visible (dialog->related_box, FALSE); /* update list_boxes */ sync_encoding_against_embed (dialog); diff --git a/src/ephy-encoding-row.c b/src/ephy-encoding-row.c index f97955ac7..1aca95358 100644 --- a/src/ephy-encoding-row.c +++ b/src/ephy-encoding-row.c @@ -52,10 +52,7 @@ ephy_encoding_row_set_selected (EphyEncodingRow *row, { g_assert (EPHY_IS_ENCODING_ROW (row)); - if (selected) - gtk_widget_show (GTK_WIDGET (row->selected_image)); - else - gtk_widget_hide (GTK_WIDGET (row->selected_image)); + gtk_widget_set_visible (GTK_WIDGET (row->selected_image), selected); } static void diff --git a/src/ephy-firefox-sync-dialog.c b/src/ephy-firefox-sync-dialog.c index 41751f82f..f779982a8 100644 --- a/src/ephy-firefox-sync-dialog.c +++ b/src/ephy-firefox-sync-dialog.c @@ -195,9 +195,9 @@ sync_secrets_store_finished_cb (EphySyncService *service, if (!error) { adw_preferences_row_set_title (ADW_PREFERENCES_ROW (sync_dialog->sync_firefox_account_row), ephy_sync_utils_get_sync_user ()); - gtk_widget_hide (sync_dialog->sync_page_group); - gtk_widget_show (sync_dialog->sync_firefox_account_group); - gtk_widget_show (sync_dialog->sync_options_group); + gtk_widget_set_visible (sync_dialog->sync_page_group, FALSE); + gtk_widget_set_visible (sync_dialog->sync_firefox_account_group, TRUE); + gtk_widget_set_visible (sync_dialog->sync_options_group, TRUE); } else { /* Display the error message and reload the iframe. */ sync_sign_in_details_show (sync_dialog, error->message); @@ -538,9 +538,9 @@ on_sync_sign_out_button_clicked (GtkWidget *button, /* Show Firefox Accounts iframe. */ sync_setup_firefox_iframe (sync_dialog); - gtk_widget_hide (sync_dialog->sync_firefox_account_group); - gtk_widget_hide (sync_dialog->sync_options_group); - gtk_widget_show (sync_dialog->sync_page_group); + gtk_widget_set_visible (sync_dialog->sync_firefox_account_group, FALSE); + gtk_widget_set_visible (sync_dialog->sync_options_group, FALSE); + gtk_widget_set_visible (sync_dialog->sync_page_group, TRUE); adw_action_row_set_subtitle (ADW_ACTION_ROW (sync_dialog->sync_firefox_account_row), NULL); } @@ -744,12 +744,12 @@ ephy_firefox_sync_dialog_setup (EphyFirefoxSyncDialog *sync_dialog) if (!user) { sync_setup_firefox_iframe (sync_dialog); - gtk_widget_hide (sync_dialog->sync_firefox_account_group); - gtk_widget_hide (sync_dialog->sync_options_group); + gtk_widget_set_visible (sync_dialog->sync_firefox_account_group, FALSE); + gtk_widget_set_visible (sync_dialog->sync_options_group, FALSE); } else { sync_set_last_sync_time (sync_dialog); adw_preferences_row_set_title (ADW_PREFERENCES_ROW (sync_dialog->sync_firefox_account_row), user); - gtk_widget_hide (sync_dialog->sync_page_group); + gtk_widget_set_visible (sync_dialog->sync_page_group, FALSE); } g_settings_bind (sync_settings, diff --git a/src/ephy-header-bar.c b/src/ephy-header-bar.c index aa37c42b1..04c607a32 100644 --- a/src/ephy-header-bar.c +++ b/src/ephy-header-bar.c @@ -285,7 +285,7 @@ ephy_header_bar_constructed (GObject *object) /* Fullscreen restore button */ header_bar->restore_button = gtk_button_new_from_icon_name ("view-restore-symbolic"); - gtk_widget_hide (header_bar->restore_button); + gtk_widget_set_visible (header_bar->restore_button, FALSE); gtk_actionable_set_action_name (GTK_ACTIONABLE (header_bar->restore_button), "win.fullscreen"); gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar->header_bar), diff --git a/src/ephy-history-dialog.c b/src/ephy-history-dialog.c index db66654b6..868002f90 100644 --- a/src/ephy-history-dialog.c +++ b/src/ephy-history-dialog.c @@ -810,7 +810,7 @@ on_clear_all_button_clicked (GtkButton *button, (gpointer *)confirmation_dialog); } - gtk_widget_show (self->confirmation_dialog); + gtk_widget_set_visible (self->confirmation_dialog, TRUE); } static void diff --git a/src/ephy-location-entry.c b/src/ephy-location-entry.c index fd27f9a7a..3c6e34253 100644 --- a/src/ephy-location-entry.c +++ b/src/ephy-location-entry.c @@ -1594,17 +1594,17 @@ ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry *self, switch (state) { case EPHY_BOOKMARK_ICON_HIDDEN: - gtk_widget_hide (self->bookmark_button); + gtk_widget_set_visible (self->bookmark_button, FALSE); gtk_widget_remove_css_class (self->bookmark_button, "starred"); break; case EPHY_BOOKMARK_ICON_EMPTY: - gtk_widget_show (self->bookmark_button); + gtk_widget_set_visible (self->bookmark_button, TRUE); gtk_menu_button_set_icon_name (GTK_MENU_BUTTON (self->bookmark_button), "ephy-non-starred-symbolic"); gtk_widget_remove_css_class (self->bookmark_button, "starred"); break; case EPHY_BOOKMARK_ICON_BOOKMARKED: - gtk_widget_show (self->bookmark_button); + gtk_widget_set_visible (self->bookmark_button, TRUE); gtk_menu_button_set_icon_name (GTK_MENU_BUTTON (self->bookmark_button), "ephy-starred-symbolic"); gtk_widget_add_css_class (self->bookmark_button, "starred"); diff --git a/src/ephy-security-popover.c b/src/ephy-security-popover.c index 29bd7a818..4537a8d12 100644 --- a/src/ephy-security-popover.c +++ b/src/ephy-security-popover.c @@ -248,7 +248,6 @@ ephy_security_popover_constructed (GObject *object) gtk_widget_set_halign (certificate_button, GTK_ALIGN_END); gtk_widget_set_margin_top (certificate_button, 5); gtk_widget_set_receives_default (certificate_button, FALSE); - gtk_widget_show (certificate_button); g_signal_connect (certificate_button, "clicked", G_CALLBACK (certificate_button_clicked_cb), popover); diff --git a/src/ephy-session.c b/src/ephy-session.c index c312b376c..d12da6ce4 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -1368,7 +1368,7 @@ session_end_element (GMarkupParseContext *ctx, active_child = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (context->window)); gtk_widget_grab_focus (GTK_WIDGET (active_child)); ephy_window_update_entry_focus (context->window, ephy_embed_get_web_view (active_child)); - gtk_widget_show (GTK_WIDGET (context->window)); + gtk_widget_set_visible (GTK_WIDGET (context->window), TRUE); } ephy_embed_shell_restored_window (shell); diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 5aff03084..f82d737c3 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -322,7 +322,7 @@ show_downloads (GSimpleAction *action, g_application_withdraw_notification (G_APPLICATION (ephy_shell), ephy_shell->open_notification_id); g_clear_pointer (&ephy_shell->open_notification_id, g_free); - gtk_widget_show (GTK_WIDGET (window)); + gtk_widget_set_visible (GTK_WIDGET (window), TRUE); g_signal_emit_by_name (manager, "show-downloads", NULL); } @@ -1024,12 +1024,11 @@ ephy_shell_new_tab_full (EphyShell *shell, "title", title, "progress-bar-enabled", ephy_embed_shell_get_mode (embed_shell) == EPHY_EMBED_SHELL_MODE_APPLICATION, NULL)); - gtk_widget_show (GTK_WIDGET (embed)); ephy_embed_container_add_child (EPHY_EMBED_CONTAINER (window), embed, parent, position, jump_to); if ((flags & EPHY_NEW_TAB_DONT_SHOW_WINDOW) == 0 && ephy_embed_shell_get_mode (embed_shell) != EPHY_EMBED_SHELL_MODE_TEST) { - gtk_widget_show (GTK_WIDGET (window)); + gtk_widget_set_visible (GTK_WIDGET (window), TRUE); } return embed; diff --git a/src/ephy-window.c b/src/ephy-window.c index fab5dc54b..8263fe145 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -653,7 +653,7 @@ static gboolean ephy_window_close_request (GtkWindow *window) { if ((ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION) && g_settings_get_boolean (EPHY_SETTINGS_WEB_APP, EPHY_PREFS_WEB_APP_RUN_IN_BACKGROUND)) { - gtk_widget_hide (GTK_WIDGET (window)); + gtk_widget_set_visible (GTK_WIDGET (window), FALSE); return TRUE; } @@ -1942,7 +1942,7 @@ web_view_ready_cb (WebKitWebView *web_view, g_signal_emit_by_name (parent_web_view, "new-window", web_view); } - gtk_widget_show (GTK_WIDGET (window)); + gtk_widget_set_visible (GTK_WIDGET (window), TRUE); return TRUE; } @@ -2101,7 +2101,7 @@ decide_navigation_policy (WebKitWebView *web_view, if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION) { if (!gtk_widget_is_visible (GTK_WIDGET (window))) { if (ephy_web_application_is_uri_allowed (uri)) { - gtk_widget_show (GTK_WIDGET (window)); + gtk_widget_set_visible (GTK_WIDGET (window), TRUE); } else { ephy_file_open_uri_in_default_browser (uri, gdk_surface_get_display (gtk_native_get_surface (GTK_NATIVE (window)))); @@ -2846,7 +2846,7 @@ run_downloads_in_background (EphyWindow *window, ephy_shell_send_notification (ephy_shell_get_default (), "progress", notification); - gtk_widget_hide (GTK_WIDGET (window)); + gtk_widget_set_visible (GTK_WIDGET (window), FALSE); } static gboolean @@ -3454,7 +3454,6 @@ add_default_browser_question (GtkBox *box) label = gtk_label_new (_("Set Epiphany Technology Preview as your default browser?")); #endif gtk_label_set_wrap (GTK_LABEL (label), TRUE); - gtk_widget_show (label); info_bar = gtk_info_bar_new (); gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar), GTK_MESSAGE_QUESTION); @@ -4268,7 +4267,7 @@ ephy_window_close (EphyWindow *window) } /* See bug #114689 */ - gtk_widget_hide (GTK_WIDGET (window)); + gtk_widget_set_visible (GTK_WIDGET (window), FALSE); return TRUE; } diff --git a/src/preferences/extension-view.c b/src/preferences/extension-view.c index 02b2fdb9f..a38be1538 100644 --- a/src/preferences/extension-view.c +++ b/src/preferences/extension-view.c @@ -160,11 +160,11 @@ update (EphyExtensionView *self) /* Information Rows */ gtk_label_set_label (GTK_LABEL (self->version_label), ephy_web_extension_get_version (self->web_extension)); if (*ephy_web_extension_get_author (self->web_extension)) { - gtk_widget_show (self->author_row); + gtk_widget_set_visible (self->author_row, TRUE); gtk_label_set_label (GTK_LABEL (self->author_label), ephy_web_extension_get_author (self->web_extension)); } if (*ephy_web_extension_get_homepage_url (self->web_extension)) - gtk_widget_show (self->homepage_row); + gtk_widget_set_visible (self->homepage_row, TRUE); gtk_switch_set_active (self->enabled_switch, ephy_web_extension_manager_is_active (manager, self->web_extension)); diff --git a/src/preferences/passwords-view.c b/src/preferences/passwords-view.c index cbbd38a47..4c166177d 100644 --- a/src/preferences/passwords-view.c +++ b/src/preferences/passwords-view.c @@ -211,7 +211,7 @@ forget_all (GSimpleAction *action, (gpointer *)confirmation_dialog); } - gtk_widget_show (self->confirmation_dialog); + gtk_widget_set_visible (self->confirmation_dialog, TRUE); } static void @@ -331,7 +331,7 @@ password_filter (GtkListBoxRow *row, const char *search_text = ephy_data_view_get_search_text (EPHY_DATA_VIEW (passwords_view)); if (search_text == NULL) { - gtk_widget_show (GTK_WIDGET (row)); + gtk_widget_set_visible (GTK_WIDGET (row), TRUE); return TRUE; } diff --git a/src/preferences/prefs-general-page.c b/src/preferences/prefs-general-page.c index fc027ee6d..99ef7414d 100644 --- a/src/preferences/prefs-general-page.c +++ b/src/preferences/prefs-general-page.c @@ -1073,7 +1073,7 @@ setup_general_page (PrefsGeneralPage *general_page) /* ========================== Downloads =================================== */ /* ======================================================================== */ if (ephy_is_running_inside_sandbox ()) - gtk_widget_hide (general_page->download_box); + gtk_widget_set_visible (general_page->download_box, FALSE); else g_settings_bind_with_mapping (EPHY_SETTINGS_STATE, EPHY_PREFS_STATE_DOWNLOAD_DIR, diff --git a/src/webextension/ephy-web-extension-manager.c b/src/webextension/ephy-web-extension-manager.c index 6c0c06d8a..b6e4e47d4 100644 --- a/src/webextension/ephy-web-extension-manager.c +++ b/src/webextension/ephy-web-extension-manager.c @@ -1061,7 +1061,7 @@ on_popup_load_changed (WebKitWebView *web_view, /* TODO: Other browsers resize on DOM changes. * We also need to limit this to a max size of 800x600 like Firefox. */ if (load_event == WEBKIT_LOAD_FINISHED) - gtk_widget_show (GTK_WIDGET (web_view)); + gtk_widget_set_visible (GTK_WIDGET (web_view), TRUE); } static void @@ -1102,7 +1102,7 @@ ephy_web_extension_manager_create_browser_popup (EphyWebExtensionManager *self, web_view = ephy_web_extensions_manager_create_web_extensions_webview (web_extension); gtk_widget_set_hexpand (web_view, TRUE); gtk_widget_set_vexpand (web_view, TRUE); - gtk_widget_hide (web_view); /* Shown in on_popup_load_changed. */ + gtk_widget_set_visible (web_view, FALSE); /* Shown in on_popup_load_changed. */ ephy_web_extension_manager_register_popup_view (self, web_extension, web_view); diff --git a/src/window-commands.c b/src/window-commands.c index 5c65c9be4..f908b7c8d 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -948,7 +948,7 @@ window_cmd_show_shortcuts (GSimpleAction *action, shortcuts_window = GTK_WIDGET (gtk_builder_get_object (builder, "shortcuts-dialog")); if (!ephy_can_install_web_apps ()) - gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, "shortcuts-web-apps-group"))); + gtk_widget_set_visible (GTK_WIDGET (gtk_builder_get_object (builder, "shortcuts-web-apps-group")), FALSE); if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) { GtkShortcutsShortcut *shortcut; |