summaryrefslogtreecommitdiff
path: root/lib/widgets/ephy-downloads-popover.c
diff options
context:
space:
mode:
authorAlexander Mikhaylenko <alexm@gnome.org>2021-12-01 12:32:14 +0500
committerMarge Bot <marge-bot@gnome.org>2021-12-02 16:56:50 +0000
commit563b03a3f54a58f9ede696c54fbe446ccdf34e38 (patch)
tree3135db7ec3ffff4a5681e0747dc2384df5ab2b64 /lib/widgets/ephy-downloads-popover.c
parent806e7704514767fc7585f261ff15bdf2b52ff19e (diff)
downloadepiphany-563b03a3f54a58f9ede696c54fbe446ccdf34e38.tar.gz
Unify gtk_box_pack_*() arguments
In GTK4 gtk_box_pack_start() is gone, replaced with gtk_box_append(). More importantly, child properties are gone and pack_start() allows to set them. With this in mind, stop using anything other than their default values: FALSE, TRUE, 0. Everything else can be done with halign, valign, hexpand, vexpand and margins. gtk_box_pack_end() is gone as well. Replace with pack_start() where possible (which involves rearranging the order in which widgets are added), and the remaining uses at this point can be replaced with gtk_box_prepend(). Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1038>
Diffstat (limited to 'lib/widgets/ephy-downloads-popover.c')
-rw-r--r--lib/widgets/ephy-downloads-popover.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/widgets/ephy-downloads-popover.c b/lib/widgets/ephy-downloads-popover.c
index 9711c0070..c91857671 100644
--- a/lib/widgets/ephy-downloads-popover.c
+++ b/lib/widgets/ephy-downloads-popover.c
@@ -170,7 +170,7 @@ static void
ephy_downloads_popover_init (EphyDownloadsPopover *popover)
{
GtkWidget *scrolled_window;
- GtkWidget *vbox, *hbox;
+ GtkWidget *vbox;
GList *downloads, *l;
EphyDownloadsManager *manager = ephy_embed_shell_get_downloads_manager (ephy_embed_shell_get_default ());
@@ -222,27 +222,22 @@ ephy_downloads_popover_init (EphyDownloadsPopover *popover)
G_CALLBACK (download_removed_cb),
popover, G_CONNECT_SWAPPED);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, FALSE, TRUE, 0);
gtk_widget_show (scrolled_window);
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_widget_set_valign (hbox, GTK_ALIGN_CENTER);
- gtk_widget_set_margin_start (hbox, 12);
- gtk_widget_set_margin_end (hbox, 12);
- gtk_widget_set_margin_top (hbox, 12);
- gtk_widget_set_margin_bottom (hbox, 12);
-
popover->clear_button = gtk_button_new_with_mnemonic (_("_Clear All"));
gtk_widget_set_sensitive (popover->clear_button, !ephy_downloads_manager_has_active_downloads (manager));
g_signal_connect_swapped (popover->clear_button, "clicked",
G_CALLBACK (clear_button_clicked_cb),
popover);
- gtk_box_pack_end (GTK_BOX (hbox), popover->clear_button, FALSE, FALSE, 0);
+ gtk_widget_set_halign (popover->clear_button, GTK_ALIGN_END);
+ gtk_widget_set_margin_start (popover->clear_button, 12);
+ gtk_widget_set_margin_end (popover->clear_button, 12);
+ gtk_widget_set_margin_top (popover->clear_button, 12);
+ gtk_widget_set_margin_bottom (popover->clear_button, 12);
+ gtk_box_pack_start (GTK_BOX (vbox), popover->clear_button, FALSE, TRUE, 0);
gtk_widget_show (popover->clear_button);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- gtk_widget_show (hbox);
-
gtk_container_add (GTK_CONTAINER (popover), vbox);
gtk_widget_show (vbox);
}