[gnome-control-center] common: time-entry: Fix changing time clicking the buttons



commit 9dfaca3725b454bb002418f0f51394714f658570
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Thu Jan 20 22:19:30 2022 +0530

    common: time-entry: Fix changing time clicking the buttons
    
    The change-value signal was not handled when emitted.  Add a handler
    to handle the signal and update time as needed.

 panels/common/cc-time-entry.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/panels/common/cc-time-entry.c b/panels/common/cc-time-entry.c
index 220385648..934c6cb63 100644
--- a/panels/common/cc-time-entry.c
+++ b/panels/common/cc-time-entry.c
@@ -265,6 +265,19 @@ change_value_cb (GtkWidget *widget,
   return GDK_EVENT_STOP;
 }
 
+static void
+value_changed_cb (CcTimeEntry   *self,
+                  GtkScrollType  type)
+{
+  g_autoptr(GVariant) value;
+
+  g_assert (CC_IS_TIME_ENTRY (self));
+
+  value = g_variant_new_int32 (type);
+
+  change_value_cb (GTK_WIDGET (self), value, NULL);
+}
+
 static void
 on_text_cut_clipboard_cb (GtkText     *text,
                           CcTimeEntry *self)
@@ -525,6 +538,8 @@ cc_time_entry_init (CcTimeEntry *self)
                     "signal::paste-clipboard", on_text_paste_clipboard_cb, self,
                     "signal::toggle-overwrite", on_text_toggle_overwrite_cb, self,
                     NULL);
+  g_signal_connect (self, "change-value",
+                    G_CALLBACK (value_changed_cb), self);
 }
 
 GtkWidget *


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