[gnome-bluetooth] lib: Replace gtk_box_pack_start() by gtk_box_append()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] lib: Replace gtk_box_pack_start() by gtk_box_append()
- Date: Thu, 28 Oct 2021 15:29:59 +0000 (UTC)
commit 1773d31fae4e8253146f306278ce7790d4ef7445
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Oct 27 13:40:42 2021 -0300
lib: Replace gtk_box_pack_start() by gtk_box_append()
Replace the "expand" child property by the "hexpand" and "vexpand"
widget properties.
lib/bluetooth-settings-widget.c | 12 +++++++-----
lib/test-client.c | 7 ++++---
2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 089cac2e..b160e4c0 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -1535,12 +1535,13 @@ add_device_section (BluetoothSettingsWidget *self)
vbox = WID ("vbox_bluetooth");
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_vexpand (box, TRUE);
gtk_widget_set_margin_top (box, 6);
- gtk_box_pack_start (GTK_BOX (vbox), box, TRUE, TRUE, 0);
+ gtk_box_append (GTK_BOX (vbox), box);
priv->child_box = box;
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, TRUE, 0);
+ gtk_box_append (GTK_BOX (box), hbox);
s = g_markup_printf_escaped ("<b>%s</b>", _("Devices"));
priv->device_label = gtk_label_new (s);
@@ -1552,7 +1553,7 @@ add_device_section (BluetoothSettingsWidget *self)
NULL);
gtk_widget_set_margin_end (priv->device_label, 6);
gtk_widget_set_margin_bottom (priv->device_label, 12);
- gtk_box_pack_start (GTK_BOX (hbox), priv->device_label, FALSE, TRUE, 0);
+ gtk_box_append (GTK_BOX (hbox), priv->device_label);
/* Discoverable spinner */
priv->device_spinner = spinner = gtk_spinner_new ();
@@ -1560,7 +1561,7 @@ add_device_section (BluetoothSettingsWidget *self)
G_OBJECT (priv->device_spinner), "active",
G_BINDING_SYNC_CREATE);
gtk_widget_set_margin_bottom (spinner, 12);
- gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, TRUE, 0);
+ gtk_box_append (GTK_BOX (hbox), spinner);
/* Discoverable label placeholder, the real name is set in update_visibility().
* If you ever see this string during normal use, please file a bug. */
@@ -1594,9 +1595,10 @@ add_device_section (BluetoothSettingsWidget *self)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
+ gtk_widget_set_vexpand (frame, TRUE);
gtk_frame_set_child (GTK_FRAME (frame), priv->device_list);
gtk_stack_add_named (GTK_STACK (priv->device_stack), frame, DEVICES_PAGE);
- gtk_box_pack_start (GTK_BOX (box), priv->device_stack, TRUE, TRUE, 0);
+ gtk_box_append (GTK_BOX (box), priv->device_stack);
gtk_widget_show_all (box);
}
diff --git a/lib/test-client.c b/lib/test-client.c
index 258b17de..5bff9d20 100644
--- a/lib/test-client.c
+++ b/lib/test-client.c
@@ -152,16 +152,17 @@ static void create_window(void)
toolbar = gtk_toolbar_new();
gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), FALSE);
- gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, TRUE, 0);
+ gtk_box_append(GTK_BOX(vbox), toolbar);
item = gtk_tool_button_new (gtk_image_new_from_icon_name ("view-refresh"), NULL);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
g_signal_connect(item, "clicked", G_CALLBACK(scan_callback), NULL);
scrolled = gtk_scrolled_window_new(NULL, NULL);
+ gtk_widget_set_vexpand(scrolled, TRUE);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0);
+ gtk_box_append (GTK_BOX (vbox), scrolled);
tree = gtk_tree_view_new();
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), TRUE);
@@ -244,7 +245,7 @@ static void create_window(void)
gtk_tree_view_expand_all(GTK_TREE_VIEW(tree));
statusbar = gtk_statusbar_new();
- gtk_box_pack_start(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0);
+ gtk_box_append(GTK_BOX(vbox), statusbar);
gtk_window_present(GTK_WINDOW(window));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]