[gtksourceview/wip/chergert/gsv-gtk4: 256/259] snippets: resize tooltips when moving snippets




commit aa196c6f31adfb82cb4c6ac9f2af3123f2617cbd
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 10 16:39:00 2020 -0700

    snippets: resize tooltips when moving snippets
    
    This allows the tooltip to shrink back to it's smallest size rather than
    being pinned to the largest size.

 gtksourceview/gtksourceview-snippets.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/gtksourceview-snippets.c b/gtksourceview/gtksourceview-snippets.c
index 731c46b9..64d41ec9 100644
--- a/gtksourceview/gtksourceview-snippets.c
+++ b/gtksourceview/gtksourceview-snippets.c
@@ -314,7 +314,15 @@ gtk_source_view_snippets_update_informative (GtkSourceViewSnippets *snippets)
 
        _gtk_source_assistant_set_mark (GTK_SOURCE_ASSISTANT (snippets->informative), chunk->begin_mark);
        gtk_source_informative_set_message (snippets->informative, tooltip_text);
-       gtk_widget_show (GTK_WIDGET (snippets->informative));
+
+       if (gtk_widget_get_visible (GTK_WIDGET (snippets->informative)))
+       {
+               _gtk_source_assistant_reposition (GTK_SOURCE_ASSISTANT (snippets->informative));
+       }
+       else
+       {
+               gtk_widget_show (GTK_WIDGET (snippets->informative));
+       }
 
        return;
 


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