summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hergert <chergert@redhat.com>2022-09-06 13:56:36 -0700
committerChristian Hergert <chergert@redhat.com>2022-09-06 13:56:36 -0700
commit23ffbdf4975d1e66a169408966430cb85205fea1 (patch)
tree456e3f78a5419c66b863a50799fb7f2422089841
parent550b9a9836bbbc2f9c184682e97f0fc2357459bd (diff)
downloadgtksourceview-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.c9
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