summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJonas Dreßler <verdre@v0yd.nl>2022-02-15 21:19:06 +0100
committerJonas Dreßler <verdre@v0yd.nl>2022-02-15 21:33:02 +0100
commit051b1914a814462fe5856b870cbf970326d7f118 (patch)
tree315dfe2aef91f2173659c093da8f474c58b801af /lib
parentdc1e35ac07762d648d36f40b987d645703f34ecf (diff)
downloadgnome-bluetooth-051b1914a814462fe5856b870cbf970326d7f118.tar.gz
settings-row: Actually start the GtkSpinner
Apparently in gtk4 the spinner needs to be actually started to show it. While at it move the exclusive showing/hiding of the status widget and spinner into label_might_change() instead of the double BIDIRECTIONAL property bind.
Diffstat (limited to 'lib')
-rw-r--r--lib/bluetooth-settings-row.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/bluetooth-settings-row.c b/lib/bluetooth-settings-row.c
index 856d1d16..51d509e7 100644
--- a/lib/bluetooth-settings-row.c
+++ b/lib/bluetooth-settings-row.c
@@ -81,10 +81,17 @@ label_might_change (BluetoothSettingsRow *self)
else
gtk_label_set_text (GTK_LABEL (self->status), _("Disconnected"));
- if (self->pairing)
+ if (self->pairing) {
+ gtk_widget_hide (self->status);
+
+ gtk_spinner_start (GTK_SPINNER (self->spinner));
gtk_widget_show (self->spinner);
- else
+ } else {
+ gtk_spinner_stop (GTK_SPINNER (self->spinner));
+ gtk_widget_hide (self->spinner);
+
gtk_widget_show (self->status);
+ }
}
static void
@@ -92,13 +99,9 @@ bluetooth_settings_row_init (BluetoothSettingsRow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- /* Placeholder text and spinner */
- g_object_bind_property (self->spinner, "visible",
- self->status, "visible", G_BINDING_INVERT_BOOLEAN | G_BINDING_BIDIRECTIONAL);
- g_object_bind_property (self->spinner, "spinning",
- self->status, "visible", G_BINDING_INVERT_BOOLEAN | G_BINDING_BIDIRECTIONAL);
-
self->time_created = g_get_monotonic_time();
+
+ label_might_change (self);
}
static void