diff options
-rw-r--r-- | include/svtools/accessibilityoptions.hxx | 5 | ||||
-rw-r--r-- | include/vcl/settings.hxx | 6 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 13 | ||||
-rw-r--r-- | svtools/source/config/accessibilityoptions.cxx | 57 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 21 | ||||
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/fontworkgallery.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabdash.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabhtch.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xtablend.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 6 |
11 files changed, 105 insertions, 13 deletions
diff --git a/include/svtools/accessibilityoptions.hxx b/include/svtools/accessibilityoptions.hxx index ccaff7e48c65..641d6fe9a706 100644 --- a/include/svtools/accessibilityoptions.hxx +++ b/include/svtools/accessibilityoptions.hxx @@ -62,6 +62,10 @@ public: // only be changed when the color palette is changed from the default sal_Int16 GetColorValueSetColumnCount() const; + // option to make previews show the content with a checkeded background to allow + // simple identification and better preview of transparent content + sal_Bool GetPreviewUsesCheckeredBackground() const; + void SetIsForPagePreviews(sal_Bool bSet); void SetIsHelpTipsDisappear(sal_Bool bSet); void SetIsAllowAnimatedGraphics(sal_Bool bSet); @@ -75,6 +79,7 @@ public: void SetEdgeBlending(sal_Int16 nSet); void SetListBoxMaximumLineCount(sal_Int16 nSet); void SetColorValueSetColumnCount(sal_Int16 nSet); + void SetPreviewUsesCheckeredBackground(sal_Bool bSet); sal_Bool IsModified() const; void Commit(); diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 10f23d44713c..545bc700c197 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -360,7 +360,7 @@ private: Size maListBoxPreviewDefaultLogicSize; Size maListBoxPreviewDefaultPixelSize; sal_uInt16 mnListBoxPreviewDefaultLineWidth; - sal_Bool mbUIPreviewUsesCheckeredBackground; + sal_Bool mbPreviewUsesCheckeredBackground; OUString maPersonaHeaderFooter; ///< Cache the settings to detect changes. @@ -935,8 +935,8 @@ public: // defines if previews which containn potentially transparent objects (e.g. the dash/line/LineStartEnd previews and others) // use the default transparent visualization background (checkered background) as it has got standard in graphic programs nowadays - void SetUIPreviewUsesCheckeredBackground(bool bNew) { CopyData(); mpData->mbUIPreviewUsesCheckeredBackground = bNew; } - bool GetUIPreviewUsesCheckeredBackground() const { return mpData->mbUIPreviewUsesCheckeredBackground; } + void SetPreviewUsesCheckeredBackground(bool bNew) { CopyData(); mpData->mbPreviewUsesCheckeredBackground = bNew; } + bool GetPreviewUsesCheckeredBackground() const { return mpData->mbPreviewUsesCheckeredBackground; } void SetStandardStyles(); diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index a50e335f9b4a..1d64c93ae71f 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -6262,6 +6262,19 @@ </info> <value>8</value> </prop> + <prop oor:name="PreviewUsesCheckeredBackground" oor:type="xs:boolean"> + <info> + <author>ALG</author> + <desc> + This option allows to make previews (e.g. UI previews for object attirbutes) show the content with a checkeded + background to allow simple identification and better preview of transparent content, e.g. when a draw object + is filled with a transparent graphic (SVG or bitmap) the preview will show the checkered background shine + through, so the user can identify that the fill has transparency with a single look. + </desc> + <label>Shows previews with shining through checkered background to visualize transparency.</label> + </info> + <value>false</value> + </prop> </group> <group oor:name="ExternalApps" oor:extensible="true"> <info> diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx index 679d7ac9291c..6ba0a24574bb 100644 --- a/svtools/source/config/accessibilityoptions.cxx +++ b/svtools/source/config/accessibilityoptions.cxx @@ -59,6 +59,7 @@ namespace const char s_sColorValueSetColumnCount[] = "ColorValueSetColumnCount"; const char s_sEdgeBlending[] = "EdgeBlending"; const char s_sListBoxMaximumLineCount[] = "ListBoxMaximumLineCount"; + const char s_sPreviewUsesCheckeredBackground[] = "PreviewUsesCheckeredBackground"; } // class SvtAccessibilityOptions_Impl --------------------------------------------- @@ -86,6 +87,7 @@ public: sal_Int16 GetEdgeBlending() const; sal_Int16 GetListBoxMaximumLineCount() const; sal_Int16 GetColorValueSetColumnCount() const; + sal_Bool GetPreviewUsesCheckeredBackground() const; void SetAutoDetectSystemHC(sal_Bool bSet); void SetIsForPagePreviews(sal_Bool bSet); @@ -99,6 +101,7 @@ public: void SetEdgeBlending(sal_Int16 nSet); void SetListBoxMaximumLineCount(sal_Int16 nSet); void SetColorValueSetColumnCount(sal_Int16 nSet); + void SetPreviewUsesCheckeredBackground(sal_Bool bSet); sal_Bool IsModified() const { return bIsModified; }; }; @@ -357,6 +360,24 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const return nRet; } +sal_Bool SvtAccessibilityOptions_Impl::GetPreviewUsesCheckeredBackground() const +{ + css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bRet = sal_False; + + try + { + if(xNode.is()) + xNode->getPropertyValue(s_sPreviewUsesCheckeredBackground) >>= bRet; + } + catch(const css::uno::Exception& ex) + { + SAL_WARN("svtools", "Caught unexpected: " << ex.Message); + } + + return bRet; +} + void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet) { css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); @@ -583,6 +604,14 @@ void SvtAccessibilityOptions_Impl::SetVCLSettings() StyleSettingsChanged = true; } + const bool bPreviewUsesCheckeredBackground(GetPreviewUsesCheckeredBackground()); + + if(aStyleSettings.GetPreviewUsesCheckeredBackground() != bPreviewUsesCheckeredBackground) + { + aStyleSettings.SetPreviewUsesCheckeredBackground(bPreviewUsesCheckeredBackground); + StyleSettingsChanged = true; + } + if(StyleSettingsChanged) { aAllSettings.SetStyleSettings(aStyleSettings); @@ -652,6 +681,26 @@ void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet) } } +void SvtAccessibilityOptions_Impl::SetPreviewUsesCheckeredBackground(sal_Bool bSet) +{ + css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); + + try + { + if(xNode.is() && xNode->getPropertyValue(s_sPreviewUsesCheckeredBackground)!=bSet) + { + xNode->setPropertyValue(s_sPreviewUsesCheckeredBackground, css::uno::makeAny(bSet)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + + bIsModified = sal_True; + } + } + catch(const css::uno::Exception& ex) + { + SAL_WARN("svtools", "Caught unexpected: " << ex.Message); + } +} + // ----------------------------------------------------------------------- // class SvtAccessibilityOptions -------------------------------------------------- @@ -756,6 +805,10 @@ sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const { return sm_pSingleImplConfig->GetColorValueSetColumnCount(); } +sal_Bool SvtAccessibilityOptions::GetPreviewUsesCheckeredBackground() const +{ + return sm_pSingleImplConfig->GetPreviewUsesCheckeredBackground(); +} // ----------------------------------------------------------------------- void SvtAccessibilityOptions::SetAutoDetectSystemHC(sal_Bool bSet) @@ -810,6 +863,10 @@ void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet) { sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet); } +void SvtAccessibilityOptions::SetPreviewUsesCheckeredBackground(sal_Bool bSet) +{ + sm_pSingleImplConfig->SetPreviewUsesCheckeredBackground(bSet); +} // ----------------------------------------------------------------------- diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 18d5671b37f3..9dc7bb875991 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1209,7 +1209,7 @@ namespace { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) { const Point aNull(0, 0); static const sal_uInt32 nLen(8); @@ -1635,7 +1635,24 @@ void SvxPreviewBase::LocalPrePaint() mpBufferDevice->SetMapMode(GetMapMode()); } - mpBufferDevice->Erase(); + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) + { + const Point aNull(0, 0); + static const sal_uInt32 nLen(8); + static const Color aW(COL_WHITE); + static const Color aG(0xef, 0xef, 0xef); + const bool bWasEnabled(mpBufferDevice->IsMapModeEnabled()); + + mpBufferDevice->EnableMapMode(false); + mpBufferDevice->DrawCheckered(aNull, mpBufferDevice->GetOutputSizePixel(), nLen, aW, aG); + mpBufferDevice->EnableMapMode(bWasEnabled); + } + else + { + mpBufferDevice->Erase(); + } } void SvxPreviewBase::LocalPostPaint() diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 3e154f480f95..2aacbaab4539 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -262,7 +262,7 @@ void drawTransparenceBackground(OutputDevice& rOut, const Point& rPos, const Siz { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) { // draw checkered background static const sal_uInt32 nLen(8); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 1b5cad9286ef..d1f410404ccc 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -130,7 +130,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId) aVDev.SetOutputSizePixel(aSize); - if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) { static const sal_uInt32 nLen(8); static const Color aW(COL_WHITE); diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx index 93ada53f8d76..ea9fb0100e5d 100644 --- a/svx/source/xoutdev/xtabdash.cxx +++ b/svx/source/xoutdev/xtabdash.cxx @@ -146,7 +146,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash) ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT : DRAWMODE_DEFAULT); - if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) { const Point aNull(0, 0); static const sal_uInt32 nLen(8 * nFactor); diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx index 8235cabe0ce7..2a1edd15dc1f 100644 --- a/svx/source/xoutdev/xtabhtch.cxx +++ b/svx/source/xoutdev/xtabhtch.cxx @@ -150,7 +150,7 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex ) ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT : DRAWMODE_DEFAULT); - if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) { const Point aNull(0, 0); static const sal_uInt32 nLen(8); diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx index d5bc78960b5a..1dae9c89c33e 100644 --- a/svx/source/xoutdev/xtablend.cxx +++ b/svx/source/xoutdev/xtablend.cxx @@ -131,7 +131,7 @@ Bitmap XLineEndList::CreateBitmapForUI( long nIndex ) ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT : DRAWMODE_DEFAULT); - if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) + if(rStyleSettings.GetPreviewUsesCheckeredBackground()) { const Point aNull(0, 0); static const sal_uInt32 nLen(8); diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 6539d385b083..141207150ff7 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -243,7 +243,7 @@ ImplStyleData::ImplStyleData() : maListBoxPreviewDefaultLogicSize = Size(15, 7); maListBoxPreviewDefaultPixelSize = Size(0, 0); // on-demand calculated in GetListBoxPreviewDefaultPixelSize() mnListBoxPreviewDefaultLineWidth = 1; - mbUIPreviewUsesCheckeredBackground = true; + mbPreviewUsesCheckeredBackground = true; SetStandardStyles(); } @@ -367,7 +367,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : maListBoxPreviewDefaultLogicSize = rData.maListBoxPreviewDefaultLogicSize; maListBoxPreviewDefaultPixelSize = rData.maListBoxPreviewDefaultPixelSize; mnListBoxPreviewDefaultLineWidth = rData.mnListBoxPreviewDefaultLineWidth; - mbUIPreviewUsesCheckeredBackground = rData.mbUIPreviewUsesCheckeredBackground; + mbPreviewUsesCheckeredBackground = rData.mbPreviewUsesCheckeredBackground; } // ----------------------------------------------------------------------- @@ -985,7 +985,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const (mpData->maListBoxPreviewDefaultLogicSize == rSet.mpData->maListBoxPreviewDefaultLogicSize) && (mpData->maListBoxPreviewDefaultPixelSize == rSet.mpData->maListBoxPreviewDefaultPixelSize) && (mpData->mnListBoxPreviewDefaultLineWidth == rSet.mpData->mnListBoxPreviewDefaultLineWidth) && - (mpData->mbUIPreviewUsesCheckeredBackground == rSet.mpData->mbUIPreviewUsesCheckeredBackground)) + (mpData->mbPreviewUsesCheckeredBackground == rSet.mpData->mbPreviewUsesCheckeredBackground)) return sal_True; else return sal_False; |