From 39fbcc330b20f2f4d1c93024734f1b330edd5408 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 28 Oct 2021 17:11:08 +0100 Subject: gtk4: use a GtkPicture for arbitrary size/ratio toolbar images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- vcl/unx/gtk3/gtkinst.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vcl') 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); } -- cgit