[gtksourceview] hoverassistant: dismiss assistant on scroll
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] hoverassistant: dismiss assistant on scroll
- Date: Thu, 1 Sep 2022 01:00:03 +0000 (UTC)
commit 78a08a12b3946b7b0fcf41432ead3c9be1eeeecb
Author: Christian Hergert <chergert redhat com>
Date: Wed Aug 31 17:59:38 2022 -0700
hoverassistant: dismiss assistant on scroll
We had this previously, and I thought we'd be able to drop it, but it is
still needed even with autohide changes.
gtksourceview/gtksourcehoverassistant.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gtksourceview/gtksourcehoverassistant.c b/gtksourceview/gtksourcehoverassistant.c
index 1abe01bc..6c634c7d 100644
--- a/gtksourceview/gtksourcehoverassistant.c
+++ b/gtksourceview/gtksourcehoverassistant.c
@@ -325,11 +325,21 @@ gtk_source_hover_assistant_class_init (GtkSourceHoverAssistantClass *klass)
static void
gtk_source_hover_assistant_init (GtkSourceHoverAssistant *self)
{
+ GtkEventController *scroll;
+
gtk_widget_add_css_class (GTK_WIDGET (self), "hover-assistant");
gtk_popover_set_autohide (GTK_POPOVER (self), FALSE);
gtk_popover_set_position (GTK_POPOVER (self), GTK_POS_TOP);
+ scroll = gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);
+ g_signal_connect_object (scroll,
+ "scroll",
+ G_CALLBACK (_gtk_source_hover_assistant_dismiss),
+ self,
+ G_CONNECT_SWAPPED);
+ gtk_widget_add_controller (GTK_WIDGET (self), g_steal_pointer (&scroll));
+
self->display = g_object_new (GTK_SOURCE_TYPE_HOVER_DISPLAY, NULL);
_gtk_source_assistant_set_child (GTK_SOURCE_ASSISTANT (self), GTK_WIDGET (self->display));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]