summaryrefslogtreecommitdiff
path: root/gtk/gtkpicture.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte.benjamin@googlemail.com>2020-12-04 02:04:19 +0000
committerBenjamin Otte <otte.benjamin@googlemail.com>2020-12-04 02:04:19 +0000
commit66c3a43e963b3a751ec272c5bfeaa93a69a10b77 (patch)
treefe7a347f05a2e67267222fe175290e360199130f /gtk/gtkpicture.c
parentf1ff8f9aadd0c07c9c21e9a3f934296e1aa859d4 (diff)
downloadgtk+-66c3a43e963b3a751ec272c5bfeaa93a69a10b77.tar.gz
Add docs about sizing pictures
Suggested by Christopher Davis.
Diffstat (limited to 'gtk/gtkpicture.c')
-rw-r--r--gtk/gtkpicture.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtkpicture.c b/gtk/gtkpicture.c
index 78e5ba449a..bd4d9a91bb 100644
--- a/gtk/gtkpicture.c
+++ b/gtk/gtkpicture.c
@@ -56,6 +56,18 @@
* In this case, gtk_picture_new_for_resource() and gtk_picture_set_resource()
* should be used.
*
+ * # Sizing the paintable
+ *
+ * You can influence how the paintable is displayed inside the #GtkPicture.
+ * By turning off GtkPicture::keep-aspect-ratio you can allow the paintable
+ * to get stretched. GtkPicture::can-shrink can be unset to make
+ * sure that paintables are never made smaller than their ideal size - but be
+ * careful if you do not know the size of the paintable in use (like when
+ * displaying user-loaded images). This can easily cause the picture to grow larger
+ * than the screen. And GtkWidget::halign and GtkWidget::valign can be used
+ * to make sure the paintable doesn't fill all available space but is instead
+ * displayed at its original size.
+ *
* # CSS nodes
*
* GtkPicture has a single CSS node with the name picture.