[gnome-bluetooth] settings-row: Actually start the GtkSpinner



commit 051b1914a814462fe5856b870cbf970326d7f118
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Tue Feb 15 21:19:06 2022 +0100

    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.

 lib/bluetooth-settings-row.c | 19 +++++++++++--------
 1 file 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]