[gnome-software: 1/2] picture: Resize when setting the pixbuf




commit 3cbb9342d0d4a1c96194aedd4d784463ae6ecab7
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Aug 3 12:40:43 2021 +0200

    picture: Resize when setting the pixbuf
    
    Redrawing isn't enough, we need to take the new pixbuf's size into
    account.

 src/gs-picture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-picture.c b/src/gs-picture.c
index d0ee27e4e..d62bff1b9 100644
--- a/src/gs-picture.c
+++ b/src/gs-picture.c
@@ -64,7 +64,7 @@ gs_picture_get_pixbuf (GsPicture *picture)
  * @pixbuf: (transfer none) (nullable): new pixbuf
  *
  * Set the value of #GsPicture:pixbuf, and schedule the widget to
- * be redrawn. The new pixbuf will be scaled to fit the widget’s
+ * be resized. The new pixbuf will be scaled to fit the widget’s
  * existing size allocation.
  *
  * Since: 41
@@ -78,7 +78,7 @@ gs_picture_set_pixbuf (GsPicture *picture, GdkPixbuf *pixbuf)
                return;
 
        g_set_object (&picture->pixbuf, pixbuf);
-       gtk_widget_queue_draw (GTK_WIDGET (picture));
+       gtk_widget_queue_resize (GTK_WIDGET (picture));
 
        g_object_notify_by_pspec (G_OBJECT (picture), obj_props[PROP_PIXBUF]);
 }


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