diff options
author | Christian Hergert <chergert@redhat.com> | 2022-09-06 13:56:36 -0700 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2022-09-06 13:56:36 -0700 |
commit | 23ffbdf4975d1e66a169408966430cb85205fea1 (patch) | |
tree | 456e3f78a5419c66b863a50799fb7f2422089841 | |
parent | 550b9a9836bbbc2f9c184682e97f0fc2357459bd (diff) | |
download | gtksourceview-23ffbdf4975d1e66a169408966430cb85205fea1.tar.gz |
hoverassistant: adjust target location by child left margin
This way things still relatively line up with the text inside the hover
assistant popover.
-rw-r--r-- | gtksourceview/gtksourcehoverassistant.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtksourceview/gtksourcehoverassistant.c b/gtksourceview/gtksourcehoverassistant.c index 6c634c7d..49f8591e 100644 --- a/gtksourceview/gtksourcehoverassistant.c +++ b/gtksourceview/gtksourcehoverassistant.c @@ -283,7 +283,16 @@ static void gtk_source_hover_assistant_get_target_location (GtkSourceAssistant *assistant, GdkRectangle *rect) { + GtkSourceHoverAssistant *self = GTK_SOURCE_HOVER_ASSISTANT (assistant); + GtkStyleContext *style_context; + GtkBorder padding; + *rect = GTK_SOURCE_HOVER_ASSISTANT (assistant)->hovered_at; + + style_context = gtk_widget_get_style_context (GTK_WIDGET (self->display)); + gtk_style_context_get_padding (style_context, &padding); + + rect->x -= padding.left; } static void |