[gtk+] entry: Allocate the progress bar only what it needs



commit c35cb0eb1be9deb87295855b27f88057899d07b1
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Dec 9 23:48:35 2017 -0500

    entry: Allocate the progress bar only what it needs
    
    We were allocating the progress bar to the full size
    of the entry. This made entry icons loose their cursors,
    since they were 'covered' by the progress bar, even though
    it doesn't draw anything there.

 gtk/gtkentry.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index fec7dc4..0ec3702 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3296,11 +3296,17 @@ gtk_entry_size_allocate (GtkWidget           *widget,
   if (priv->progress_widget && gtk_widget_get_visible (priv->progress_widget))
     {
       GtkAllocation progress_alloc;
+      int min, nat;
 
+      gtk_widget_measure (priv->progress_widget,
+                          GTK_ORIENTATION_VERTICAL,
+                          -1,
+                          &min, &nat,
+                          NULL, NULL);
       progress_alloc.x = 0;
-      progress_alloc.y = 0;
+      progress_alloc.y = allocation->height - nat;
       progress_alloc.width = allocation->width;
-      progress_alloc.height = allocation->height;
+      progress_alloc.height = nat;
 
       gtk_widget_size_allocate (priv->progress_widget, &progress_alloc, -1, &child_clip);
       gdk_rectangle_union (out_clip, &child_clip, out_clip);


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