[gtksourceview] view: fix position of right-margin
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] view: fix position of right-margin
- Date: Tue, 12 Apr 2022 03:56:44 +0000 (UTC)
commit cac686d42be6dfe420e9cb8896ff7732b4f72fbc
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 11 20:55:29 2022 -0700
view: fix position of right-margin
gtksourceview/gtksourceview.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 3d5eaa0b..19cb4d94 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2546,6 +2546,21 @@ gtk_source_view_paint_marks_background (GtkSourceView *view,
g_array_free (numbers, TRUE);
}
+static int
+get_left_gutter_size (GtkSourceView *view)
+{
+ GtkSourceViewPrivate *priv = gtk_source_view_get_instance_private (view);
+
+ if (priv->left_gutter != NULL)
+ {
+ GtkAllocation alloc;
+ gtk_widget_get_allocation (GTK_WIDGET (priv->left_gutter), &alloc);
+ return alloc.width;
+ }
+
+ return 0;
+}
+
static void
gtk_source_view_paint_right_margin (GtkSourceView *view,
GtkSnapshot *snapshot)
@@ -2569,7 +2584,7 @@ gtk_source_view_paint_right_margin (GtkSourceView *view,
'_');
}
- x = priv->cached_right_margin_pos + gtk_text_view_get_left_margin (text_view);
+ x = priv->cached_right_margin_pos + gtk_text_view_get_left_margin (text_view) + get_left_gutter_size
(view);
gtk_snapshot_append_color (snapshot,
&priv->right_margin_line_color,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]