diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-28 17:11:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-28 20:40:45 +0200 |
commit | 39fbcc330b20f2f4d1c93024734f1b330edd5408 (patch) | |
tree | 978a6c863d867abf4d71cbad495dffe5ccf66f16 | |
parent | 4f5b5a19f450ae0b2dcdb99d26f48cf3aea352ad (diff) |
gtk4: use a GtkPicture for arbitrary size/ratio toolbar images
so the wide .uno:BackgroundColor Toolbar MenuButton in
sidebarparagraph.ui is shown correctly
Change-Id: I231145092b5444fa2c70a7b3f0d85ddd6762eac1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124342
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index f2dc45eca6c4..504172208e74 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -4737,6 +4737,12 @@ namespace return gtk_image_new_from_paintable(GDK_PAINTABLE(paintable)); } + GtkWidget* picture_new_from_virtual_device(const VirtualDevice& rImageSurface) + { + SurfacePaintable* paintable = paintable_new_from_virtual_device(rImageSurface); + return gtk_picture_new_for_paintable(GDK_PAINTABLE(paintable)); + } + #else GtkWidget* image_new_from_virtual_device(const VirtualDevice& rImageSurface) { @@ -11188,7 +11194,11 @@ private: if (pDevice) { +#if GTK_CHECK_VERSION(4, 0, 0) + pImage = picture_new_from_virtual_device(*pDevice); +#else pImage = image_new_from_virtual_device(*pDevice); +#endif gtk_widget_show(pImage); } |