[gedit/wip/adjustment-checks] view: listen to scrollable h/v adjustment property changes



commit d662bf5990329568f2c288c630237a0a88839c0a
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date:   Mon Jul 25 02:51:22 2022 +0200

    view: listen to scrollable h/v adjustment property changes
    
    Indeed they change.

 gedit/gedit-view.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
---
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index ce272339a..74d85eb01 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -182,6 +182,22 @@ fonts_changed_cb (GeditSettings *settings,
        update_font (view);
 }
 
+static void
+scrollable_notify_hadjustment_cb (GtkScrollable *scrollable,
+                                 GParamSpec    *pspec,
+                                 gpointer       user_data)
+{
+       g_print ("%s()\n", G_STRFUNC);
+}
+
+static void
+scrollable_notify_vadjustment_cb (GtkScrollable *scrollable,
+                                 GParamSpec    *pspec,
+                                 gpointer       user_data)
+{
+       g_print ("%s()\n", G_STRFUNC);
+}
+
 static void
 gedit_view_constructed (GObject *object)
 {
@@ -248,6 +264,16 @@ gedit_view_constructed (GObject *object)
 
                gedit_utils_check_adjustment_changes (hadjustment);
                gedit_utils_check_adjustment_changes (vadjustment);
+
+               g_signal_connect (scrollable,
+                                 "notify::hadjustment",
+                                 G_CALLBACK (scrollable_notify_hadjustment_cb),
+                                 NULL);
+
+               g_signal_connect (scrollable,
+                                 "notify::vadjustment",
+                                 G_CALLBACK (scrollable_notify_vadjustment_cb),
+                                 NULL);
        }
 }
 


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