Kaydet (Commit) 625ce5e9 authored tarafından Caolán McNamara's avatar Caolán McNamara

allow arbitrary icons from our icon-themes to be loaded via .ui

Change-Id: I5aab159bbbd4c20788085ae3069522f248289ab2
üst e2733814
...@@ -186,7 +186,7 @@ public: ...@@ -186,7 +186,7 @@ public:
sal_Bool SetModeImage( const Image& rImage ); sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const; const Image& GetModeImage( ) const;
; virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
}; };
#endif // _SV_FIXED_HXX #endif // _SV_FIXED_HXX
......
...@@ -24,8 +24,10 @@ ...@@ -24,8 +24,10 @@
#include "vcl/dialog.hxx" #include "vcl/dialog.hxx"
#include "vcl/event.hxx" #include "vcl/event.hxx"
#include "vcl/fixed.hxx" #include "vcl/fixed.hxx"
#include "vcl/svapp.hxx"
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include "controldata.hxx" #include "controldata.hxx"
#include "impimagetree.hxx"
#include "window.h" #include "window.h"
// ======================================================================= // =======================================================================
...@@ -1193,4 +1195,23 @@ const Image& FixedImage::GetModeImage( ) const ...@@ -1193,4 +1195,23 @@ const Image& FixedImage::GetModeImage( ) const
return maImage; 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment