summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-12-05 12:03:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-12-05 12:03:16 +0000
commit625ce5e92ba1850c841ce591f7bc395243af46a6 (patch)
treeb8ca54ba826e3b82415d071a7392242c01a0e817 /vcl
parente27338143b4f8aaf8653e28a5bd6e123c7718128 (diff)
allow arbitrary icons from our icon-themes to be loaded via .ui
Change-Id: I5aab159bbbd4c20788085ae3069522f248289ab2
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/fixed.hxx2
-rw-r--r--vcl/source/control/fixed.cxx21
2 files changed, 22 insertions, 1 deletions
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index 94d70dc399de..c36b63d73ec9 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -186,7 +186,7 @@ public:
sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
-;
+ virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
};
#endif // _SV_FIXED_HXX
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 982e3ec3d53c..f8e8b3ddc6de 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -24,8 +24,10 @@
#include "vcl/dialog.hxx"
#include "vcl/event.hxx"
#include "vcl/fixed.hxx"
+#include "vcl/svapp.hxx"
#include <comphelper/string.hxx>
#include "controldata.hxx"
+#include "impimagetree.hxx"
#include "window.h"
// =======================================================================
@@ -1193,4 +1195,23 @@ const Image& FixedImage::GetModeImage( ) const
return maImage;
}
+bool FixedImage::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
+{
+ if (rKey == "pixbuf")
+ {
+ static ImplImageTreeSingletonRef aImageTree;
+ OUString sCurrentSymbolsStyle =
+ Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
+ const OUString sFileName(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8));
+ BitmapEx aBitmap;
+ bool bSuccess = aImageTree->loadImage(sFileName, sCurrentSymbolsStyle, aBitmap, true);
+ SAL_WARN_IF(!bSuccess, "vcl.layout", "Unable to load " << sFileName
+ << " from theme " << sCurrentSymbolsStyle);
+ SetImage(Image(aBitmap));
+ }
+ else
+ return Control::set_property(rKey, rValue);
+ return true;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */