[gtksourceview/gtksourceview-5-4] assistants: remove size hack during reposition



commit e623f563bf9ad3a00806a83b2a9c6d41074f3859
Author: Christian Hergert <chergert redhat com>
Date:   Mon Apr 18 13:23:49 2022 -0700

    assistants: remove size hack during reposition
    
    This shouldn't be necesary anymore and gets in the way now that present
    should basically be doing the right thing in GTK.

 gtksourceview/gtksourceassistant.c | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)
---
diff --git a/gtksourceview/gtksourceassistant.c b/gtksourceview/gtksourceassistant.c
index 9e907d0c..bc069e6c 100644
--- a/gtksourceview/gtksourceassistant.c
+++ b/gtksourceview/gtksourceassistant.c
@@ -140,38 +140,15 @@ _gtk_source_assistant_update_position (GtkSourceAssistant *assistant)
                _gtk_source_assistant_get_offset (child, &x, &y);
                gtk_popover_set_offset (GTK_POPOVER (child), x, y);
 
-               if (gtk_widget_get_visible (GTK_WIDGET (child)))
-               {
-                       gtk_popover_present (GTK_POPOVER (child));
-               }
+               gtk_popover_present (GTK_POPOVER (child));
        }
 }
 
-static void
-_gtk_source_assistant_update_size (GtkSourceAssistant *self)
-{
-       int min_width;
-       int nat_width;
-
-       g_assert (GTK_SOURCE_IS_ASSISTANT (self));
-
-       /* Hack to force the sizing request, otherwise the popover does
-        * not shrink as results are reduced.
-        */
-       gtk_widget_set_size_request (GTK_WIDGET (self), -1, -1);
-       gtk_widget_measure (GTK_WIDGET (self),
-                           GTK_ORIENTATION_HORIZONTAL,
-                           -1,
-                           &min_width, &nat_width, NULL, NULL);
-       gtk_widget_set_size_request (GTK_WIDGET (self), min_width, -1);
-}
-
 void
 _gtk_source_assistant_reposition (GtkSourceAssistant *self)
 {
        g_return_if_fail (GTK_SOURCE_IS_ASSISTANT (self));
 
-       _gtk_source_assistant_update_size (self);
        _gtk_source_assistant_update_position (self);
 }
 


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