diff options
-rw-r--r-- | vcl/source/control/fixed.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 28 |
2 files changed, 23 insertions, 11 deletions
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index c8ac59046181..0482c06f584f 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -960,11 +960,7 @@ Image FixedImage::loadThemeImage(const OUString &rFileName) bool FixedImage::set_property(const OString &rKey, const OUString &rValue) { - if (rKey == "pixbuf" || rKey == "icon-name") - { - SetImage(loadThemeImage(rValue)); - } - else if (rKey == "icon-size") + if (rKey == "icon-size") { WinBits nBits = GetStyle(); nBits &= ~WB_SMALLSTYLE; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index a250fd89b214..9ea07cdb5ee3 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1071,11 +1071,22 @@ namespace OUString extractIconName(VclBuilder::stringmap &rMap) { OUString sIconName; - VclBuilder::stringmap::iterator aFind = rMap.find(OString("icon-name")); - if (aFind != rMap.end()) + // allow pixbuf, but prefer icon-name { - sIconName = aFind->second; - rMap.erase(aFind); + VclBuilder::stringmap::iterator aFind = rMap.find(OString("pixbuf")); + if (aFind != rMap.end()) + { + sIconName = aFind->second; + rMap.erase(aFind); + } + } + { + VclBuilder::stringmap::iterator aFind = rMap.find(OString("icon-name")); + if (aFind != rMap.end()) + { + sIconName = aFind->second; + rMap.erase(aFind); + } } return sIconName; } @@ -2126,8 +2137,13 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & } else if (name == "GtkImage") { - extractStock(id, rMap); - xWindow = VclPtr<FixedImage>::Create(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK|WB_SCALE); + VclPtr<FixedImage> xFixedImage = VclPtr<FixedImage>::Create(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK|WB_SCALE); + OUString sIconName = extractIconName(rMap); + if (!sIconName.isEmpty()) + xFixedImage->SetImage(FixedImage::loadThemeImage(sIconName)); + else + extractStock(id, rMap); + xWindow = xFixedImage; //such parentless GtkImages are temps used to set icons on buttons //default them to hidden to stop e.g. insert->index entry flicking temp //full screen windows |