diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-11 20:57:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-12 10:10:23 +0100 |
commit | 1a490b71feb2340ac4f58ff1bef983ef1115e2f3 (patch) | |
tree | 40632c2beb0f0fd7209bf975505e3b2b3a214f94 /vcl/unx | |
parent | c08ec94ae04656e5178a704445080fe6887aac5a (diff) |
allow using css::graphic::XGraphic to set menu image
Change-Id: Ice5062f26ea300aec73d5fd849484c8bc4fc43bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110793
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index d24edef22ae9..2a9e02308cd3 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8282,6 +8282,7 @@ public: virtual void insert(int pos, const OUString& rId, const OUString& rStr, const OUString* pIconName, VirtualDevice* pImageSurface, + const css::uno::Reference<css::graphic::XGraphic>* pGraphic, TriState eCheckRadioFalse) override { GtkWidget* pImage = nullptr; @@ -8297,6 +8298,14 @@ public: { pImage = image_new_from_virtual_device(*pImageSurface); } + else if (pGraphic) + { + if (GdkPixbuf* pixbuf = getPixbuf(*pGraphic)) + { + pImage = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + } + } GtkWidget *pItem; if (pImage) |