[gtksourceview/wip/chergert/gsv-gtk4: 4/4] view: notify assistants when allocation changes




commit 93ed0edcfb682fc775892811e18974763ff31fed
Author: Christian Hergert <chergert redhat com>
Date:   Sun Aug 30 09:38:58 2020 -0700

    view: notify assistants when allocation changes

 gtksourceview/gtksourceview.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index ac8c13be0..d8aa64604 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -490,6 +490,20 @@ gtk_source_view_join_lines (GtkSourceView *view)
        gtk_source_buffer_join_lines (buffer, &start, &end);
 }
 
+static void
+gtk_source_view_size_allocate (GtkWidget *widget,
+                               int        width,
+                               int        height,
+                               int        baseline)
+{
+       GtkSourceView *view = GTK_SOURCE_VIEW (widget);
+       GtkSourceViewPrivate *priv = gtk_source_view_get_instance_private (view);
+
+       GTK_WIDGET_CLASS (gtk_source_view_parent_class)->size_allocate (widget, width, height, baseline);
+
+       _gtk_source_view_assistants_size_allocate (&priv->assistants, width, height, baseline);
+}
+
 static void
 gtk_source_view_class_init (GtkSourceViewClass *klass)
 {
@@ -509,6 +523,7 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
 
        widget_class->snapshot = gtk_source_view_snapshot;
        widget_class->css_changed = gtk_source_view_css_changed;
+       widget_class->size_allocate = gtk_source_view_size_allocate;
 
        textview_class->move_cursor = gtk_source_view_move_cursor;
        textview_class->delete_from_cursor = gtk_source_view_delete_from_cursor;


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