Bugzilla – Attachment 102800 Details for
Bug 79147
Transient / HiContrast theme mis-selection race on start
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
some hacking around trying to refresh images on update
junk-experiments.diff (text/plain), 6.74 KB, created by
Michael Meeks
on 2014-07-14 20:15:54 UTC
(
hide
)
Description:
some hacking around trying to refresh images on update
Filename:
MIME Type:
Creator:
Michael Meeks
Created:
2014-07-14 20:15:54 UTC
Size:
6.74 KB
patch
obsolete
>diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx >index 1146c73..3b4602f 100644 >--- a/include/vcl/button.hxx >+++ b/include/vcl/button.hxx >@@ -74,9 +74,10 @@ public: > > static OUString GetStandardText( StandardButtonType eButton ); > >- bool SetModeImage( const Image& rImage ); >+ bool SetModeImage( const Image& rImage ); > const Image GetModeImage( ) const; >- bool HasImage() const; >+ void SetThemeImage( const OUString &rName ); >+ bool HasImage() const; > void SetImageAlign( ImageAlign eAlign ); > ImageAlign GetImageAlign() const; > >@@ -86,6 +87,7 @@ public: > void SetFocusRect( const Rectangle& rFocusRect ); > bool IsSmallSymbol() const; > void SetSmallSymbol(bool bSmall = true); >+ virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; > virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; > }; > >diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx >index 33a6632..d68c613 100644 >--- a/include/vcl/fixed.hxx >+++ b/include/vcl/fixed.hxx >@@ -165,6 +165,7 @@ class VCL_DLLPUBLIC FixedImage : public Control > private: > Image maImage; > bool mbInUserDraw; >+ OUString maThemedName; > > private: > using Control::ImplInitSettings; >@@ -192,13 +193,14 @@ public: > virtual Size GetOptimalSize() const SAL_OVERRIDE; > > void SetImage( const Image& rImage ); >+ void SetThemeImage( const OUString &rThemedName ); > const Image& GetImage() const { return maImage; } > >- bool SetModeImage( const Image& rImage ); >- const Image& GetModeImage( ) const { return maImage;} >- virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; >+ bool SetModeImage( const Image& rImage ); >+ const Image& GetModeImage() const { return maImage;} >+ virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; > >- static Image loadThemeImage(const OString &rFileName); >+ static Image loadThemeImage(const OUString &rFileName); > }; > > #endif // INCLUDED_VCL_FIXED_HXX >diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx >index 465e15a..4329e33 100644 >--- a/vcl/source/control/button.cxx >+++ b/vcl/source/control/button.cxx >@@ -66,6 +66,7 @@ public: > bool mbSmallSymbol; > > Image maImage; >+ > ImageAlign meImageAlign; > SymbolAlign meSymbolAlign; > >@@ -269,9 +270,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos, > return; > } > >- // check for HC mode ( image only! ) > Image *pImage = &(mpButtonData->maImage); >- > Size aTextSize; > Size aSymbolSize; > Size aMax; >@@ -1427,6 +1426,19 @@ void PushButton::StateChanged( StateChangedType nType ) > } > } > >+void Button::DataChanged( const DataChangedEvent& rDCEvt ) >+{ >+ Control::DataChanged( rDCEvt ); >+ >+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && >+ (rDCEvt.GetFlags() & SETTINGS_STYLE) ) >+ { >+ if ( maImageName.getLength() ) >+ { >+ } >+ } >+} >+ > void PushButton::DataChanged( const DataChangedEvent& rDCEvt ) > { > Button::DataChanged( rDCEvt ); >diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx >index 3b50a3c..67a1203 100644 >--- a/vcl/source/control/fixed.cxx >+++ b/vcl/source/control/fixed.cxx >@@ -1036,8 +1036,13 @@ void FixedImage::DataChanged( const DataChangedEvent& rDCEvt ) > (rDCEvt.GetFlags() & SETTINGS_STYLE) ) > { > ImplInitSettings(); >+ fprintf (stderr, "re-load foo '%s'\n", >+ OUStringToOString(maThemedName, RTL_TEXTENCODING_UTF8).getStr()); >+ if ( maThemedName.getLength() ) >+ SetThemeImage( maThemedName ); > Invalidate(); >- } >+ } else >+ fprintf (stderr, "don't re-load foo\n"); > } > > void FixedImage::SetImage( const Image& rImage ) >@@ -1056,16 +1061,20 @@ bool FixedImage::SetModeImage( const Image& rImage ) > return true; > } > >+void FixedImage::SetThemeImage( const OUString &rThemedName ) >+{ >+ maThemedName = rThemedName; >+ maImage = loadThemeImage(rThemedName); >+} > >-Image FixedImage::loadThemeImage(const OString &rFileName) >+Image FixedImage::loadThemeImage(const OUString &rFileName) > { > static ImplImageTreeSingletonRef aImageTree; > OUString sIconTheme = > Application::GetSettings().GetStyleSettings().DetermineIconTheme(); >- const OUString sFileName(OStringToOUString(rFileName, RTL_TEXTENCODING_UTF8)); > BitmapEx aBitmap; >- bool bSuccess = aImageTree->loadImage(sFileName, sIconTheme, aBitmap, true); >- SAL_WARN_IF(!bSuccess, "vcl.layout", "Unable to load " << sFileName >+ bool bSuccess = aImageTree->loadImage(rFileName, sIconTheme, aBitmap, true); >+ SAL_WARN_IF(!bSuccess, "vcl.layout", "Unable to load " << rFileName > << " from theme " << sIconTheme); > return Image(aBitmap); > } >@@ -1073,9 +1082,7 @@ Image FixedImage::loadThemeImage(const OString &rFileName) > bool FixedImage::set_property(const OString &rKey, const OString &rValue) > { > if (rKey == "pixbuf") >- { >- SetImage(FixedImage::loadThemeImage(rValue)); >- } >+ SetThemeImage(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); > else > return Control::set_property(rKey, rValue); > return true; >diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx >index c8f4a72..2f859b9 100644 >--- a/vcl/source/gdi/impimage.cxx >+++ b/vcl/source/gdi/impimage.cxx >@@ -43,6 +43,8 @@ ImageAryData::ImageAryData( const OUString &aName, > sal_uInt16 nId, const BitmapEx &aBitmap ) > : maName( aName ), mnId( nId ), maBitmapEx( aBitmap ) > { >+ fprintf(stderr, "ImageAryData '%s'\n", >+ OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr()); > } > > ImageAryData::~ImageAryData() >diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx >index e336a05..32b0153 100644 >--- a/vcl/source/window/builder.cxx >+++ b/vcl/source/window/builder.cxx >@@ -1544,7 +1544,12 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri > > OString sIconName(extractIconName(rMap)); > if (!sIconName.isEmpty()) >- pToolBox->SetItemImage(nItemId, FixedImage::loadThemeImage(sIconName)); >+ { >+ Image aImage(FixedImage::loadThemeImage( >+ OStringToOUString(sIconName, >+ RTL_TEXTENCODING_UTF8))); >+ pToolBox->SetItemImage(nItemId, aImage); >+ } > > if (!extractVisible(rMap)) > pToolBox->HideItem(nItemId);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 79147
:
99670
|
100865
|
100866
| 102800 |
103597
|
109545
|
114636