[gtk/matthiasc/for-master] docs: Work around GtkPicture growing



commit 163d32eea199f05167f645e3e95d445792a7ef70
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 25 21:28:26 2020 -0400

    docs: Work around GtkPicture growing
    
    Make the GtkPicture gallery image stay within its
    limits, by overpowering its request mode.

 docs/reference/gtk/images/picture.png | Bin 7086 -> 6248 bytes
 docs/tools/widgets.c                  |   7 ++++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/docs/reference/gtk/images/picture.png b/docs/reference/gtk/images/picture.png
index fb80873181..8f2a50cce8 100644
Binary files a/docs/reference/gtk/images/picture.png and b/docs/reference/gtk/images/picture.png differ
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index f101e542d9..d8ebb25093 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1067,6 +1067,7 @@ create_picture (void)
   GtkWidget *vbox;
   GtkIconTheme *theme;
   GdkPaintable *paintable;
+  GtkWidget *box;
 
   theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
   paintable = GDK_PAINTABLE (gtk_icon_theme_lookup_icon (theme,
@@ -1080,8 +1081,12 @@ create_picture (void)
   gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
   gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
 
+  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_box_append (GTK_BOX (box), g_object_new (GTK_TYPE_IMAGE, "hexpand", TRUE, NULL));
+  gtk_box_append (GTK_BOX (box), widget);
+  gtk_box_append (GTK_BOX (box), g_object_new (GTK_TYPE_IMAGE, "hexpand", TRUE, NULL));
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
-  gtk_box_append (GTK_BOX (vbox), widget);
+  gtk_box_append (GTK_BOX (vbox), box);
   gtk_box_append (GTK_BOX (vbox), gtk_label_new ("Picture"));
 
   add_margin (vbox);


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