Kaydet (Commit) c17e634e authored tarafından Armin Le Grand's avatar Armin Le Grand

i122120 corrected flag for drawing checkerboards, adapted previews, added to configuration

üst 664f4d88
...@@ -6198,6 +6198,19 @@ ...@@ -6198,6 +6198,19 @@
</info> </info>
<value>12</value> <value>12</value>
</prop> </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>
<set oor:name="OfficeObjects" oor:node-type="ObjectNames"> <set oor:name="OfficeObjects" oor:node-type="ObjectNames">
<info> <info>
......
...@@ -69,6 +69,10 @@ public: ...@@ -69,6 +69,10 @@ public:
// only be changed when the color palette is changed from the default // only be changed when the color palette is changed from the default
sal_Int16 GetColorValueSetColumnCount() const; 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 SetIsForPagePreviews(sal_Bool bSet);
void SetIsHelpTipsDisappear(sal_Bool bSet); void SetIsHelpTipsDisappear(sal_Bool bSet);
void SetIsAllowAnimatedGraphics(sal_Bool bSet); void SetIsAllowAnimatedGraphics(sal_Bool bSet);
...@@ -82,6 +86,7 @@ public: ...@@ -82,6 +86,7 @@ public:
void SetEdgeBlending(sal_Int16 nSet); void SetEdgeBlending(sal_Int16 nSet);
void SetListBoxMaximumLineCount(sal_Int16 nSet); void SetListBoxMaximumLineCount(sal_Int16 nSet);
void SetColorValueSetColumnCount(sal_Int16 nSet); void SetColorValueSetColumnCount(sal_Int16 nSet);
void SetPreviewUsesCheckeredBackground(sal_Bool bSet);
sal_Bool IsModified() const; sal_Bool IsModified() const;
void Commit(); void Commit();
......
...@@ -89,6 +89,7 @@ public: ...@@ -89,6 +89,7 @@ public:
sal_Int16 GetEdgeBlending() const; sal_Int16 GetEdgeBlending() const;
sal_Int16 GetListBoxMaximumLineCount() const; sal_Int16 GetListBoxMaximumLineCount() const;
sal_Int16 GetColorValueSetColumnCount() const; sal_Int16 GetColorValueSetColumnCount() const;
sal_Bool GetPreviewUsesCheckeredBackground() const;
void SetAutoDetectSystemHC(sal_Bool bSet); void SetAutoDetectSystemHC(sal_Bool bSet);
void SetIsForPagePreviews(sal_Bool bSet); void SetIsForPagePreviews(sal_Bool bSet);
...@@ -102,6 +103,7 @@ public: ...@@ -102,6 +103,7 @@ public:
void SetEdgeBlending(sal_Int16 nSet); void SetEdgeBlending(sal_Int16 nSet);
void SetListBoxMaximumLineCount(sal_Int16 nSet); void SetListBoxMaximumLineCount(sal_Int16 nSet);
void SetColorValueSetColumnCount(sal_Int16 nSet); void SetColorValueSetColumnCount(sal_Int16 nSet);
void SetPreviewUsesCheckeredBackground(sal_Bool bSet);
sal_Bool IsModified() const { return bIsModified; }; sal_Bool IsModified() const { return bIsModified; };
}; };
...@@ -360,6 +362,24 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const ...@@ -360,6 +362,24 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const
return nRet; 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)
{
LogHelper::logIt(ex);
}
return bRet;
}
void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet) void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet)
{ {
css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
...@@ -586,6 +606,14 @@ void SvtAccessibilityOptions_Impl::SetVCLSettings() ...@@ -586,6 +606,14 @@ void SvtAccessibilityOptions_Impl::SetVCLSettings()
StyleSettingsChanged = true; StyleSettingsChanged = true;
} }
const bool bPreviewUsesCheckeredBackground(GetPreviewUsesCheckeredBackground());
if(aStyleSettings.GetPreviewUsesCheckeredBackground() != bPreviewUsesCheckeredBackground)
{
aStyleSettings.SetPreviewUsesCheckeredBackground(bPreviewUsesCheckeredBackground);
StyleSettingsChanged = true;
}
if(StyleSettingsChanged) if(StyleSettingsChanged)
{ {
aAllSettings.SetStyleSettings(aStyleSettings); aAllSettings.SetStyleSettings(aStyleSettings);
...@@ -655,6 +683,26 @@ void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet) ...@@ -655,6 +683,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)
{
LogHelper::logIt(ex);
}
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// class SvtAccessibilityOptions -------------------------------------------------- // class SvtAccessibilityOptions --------------------------------------------------
...@@ -769,6 +817,10 @@ sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const ...@@ -769,6 +817,10 @@ sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const
{ {
return sm_pSingleImplConfig->GetColorValueSetColumnCount(); return sm_pSingleImplConfig->GetColorValueSetColumnCount();
} }
sal_Bool SvtAccessibilityOptions::GetPreviewUsesCheckeredBackground() const
{
return sm_pSingleImplConfig->GetPreviewUsesCheckeredBackground();
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvtAccessibilityOptions::SetAutoDetectSystemHC(sal_Bool bSet) void SvtAccessibilityOptions::SetAutoDetectSystemHC(sal_Bool bSet)
...@@ -823,5 +875,9 @@ void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet) ...@@ -823,5 +875,9 @@ void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet)
{ {
sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet); sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet);
} }
void SvtAccessibilityOptions::SetPreviewUsesCheckeredBackground(sal_Bool bSet)
{
sm_pSingleImplConfig->SetPreviewUsesCheckeredBackground(bSet);
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -31,19 +31,20 @@ ...@@ -31,19 +31,20 @@
namespace namespace
{ {
static const ::rtl::OUString s_sAccessibility = ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/Accessibility"); static const ::rtl::OUString s_sAccessibility = ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/Accessibility");
static const ::rtl::OUString s_sAutoDetectSystemHC = ::rtl::OUString::createFromAscii("AutoDetectSystemHC"); static const ::rtl::OUString s_sAutoDetectSystemHC = ::rtl::OUString::createFromAscii("AutoDetectSystemHC");
static const ::rtl::OUString s_sIsForPagePreviews = ::rtl::OUString::createFromAscii("IsForPagePreviews"); static const ::rtl::OUString s_sIsForPagePreviews = ::rtl::OUString::createFromAscii("IsForPagePreviews");
static const ::rtl::OUString s_sIsHelpTipsDisappear = ::rtl::OUString::createFromAscii("IsHelpTipsDisappear"); static const ::rtl::OUString s_sIsHelpTipsDisappear = ::rtl::OUString::createFromAscii("IsHelpTipsDisappear");
static const ::rtl::OUString s_sHelpTipSeconds = ::rtl::OUString::createFromAscii("HelpTipSeconds"); static const ::rtl::OUString s_sHelpTipSeconds = ::rtl::OUString::createFromAscii("HelpTipSeconds");
static const ::rtl::OUString s_sIsAllowAnimatedGraphics = ::rtl::OUString::createFromAscii("IsAllowAnimatedGraphics"); static const ::rtl::OUString s_sIsAllowAnimatedGraphics = ::rtl::OUString::createFromAscii("IsAllowAnimatedGraphics");
static const ::rtl::OUString s_sIsAllowAnimatedText = ::rtl::OUString::createFromAscii("IsAllowAnimatedText"); static const ::rtl::OUString s_sIsAllowAnimatedText = ::rtl::OUString::createFromAscii("IsAllowAnimatedText");
static const ::rtl::OUString s_sIsAutomaticFontColor = ::rtl::OUString::createFromAscii("IsAutomaticFontColor"); static const ::rtl::OUString s_sIsAutomaticFontColor = ::rtl::OUString::createFromAscii("IsAutomaticFontColor");
static const ::rtl::OUString s_sIsSystemFont = ::rtl::OUString::createFromAscii("IsSystemFont"); static const ::rtl::OUString s_sIsSystemFont = ::rtl::OUString::createFromAscii("IsSystemFont");
static const ::rtl::OUString s_sIsSelectionInReadonly = ::rtl::OUString::createFromAscii("IsSelectionInReadonly"); static const ::rtl::OUString s_sIsSelectionInReadonly = ::rtl::OUString::createFromAscii("IsSelectionInReadonly");
static const ::rtl::OUString s_sEdgeBlending = ::rtl::OUString::createFromAscii("EdgeBlending"); static const ::rtl::OUString s_sEdgeBlending = ::rtl::OUString::createFromAscii("EdgeBlending");
static const ::rtl::OUString s_sListBoxMaximumLineCount = ::rtl::OUString::createFromAscii("ListBoxMaximumLineCount"); static const ::rtl::OUString s_sListBoxMaximumLineCount = ::rtl::OUString::createFromAscii("ListBoxMaximumLineCount");
static const ::rtl::OUString s_sColorValueSetColumnCount = ::rtl::OUString::createFromAscii("ColorValueSetColumnCount"); static const ::rtl::OUString s_sColorValueSetColumnCount = ::rtl::OUString::createFromAscii("ColorValueSetColumnCount");
static const ::rtl::OUString s_sPreviewUsesCheckeredBackground = ::rtl::OUString::createFromAscii("PreviewUsesCheckeredBackground");
} }
#endif // INCLUDE_CONFIGITEMS_ACCESSIBILITYOPTIONS_CONST_HXX #endif // INCLUDE_CONFIGITEMS_ACCESSIBILITYOPTIONS_CONST_HXX
...@@ -1416,7 +1416,7 @@ namespace ...@@ -1416,7 +1416,7 @@ namespace
{ {
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) if(rStyleSettings.GetPreviewUsesCheckeredBackground())
{ {
const Point aNull(0, 0); const Point aNull(0, 0);
static const sal_uInt32 nLen(8); static const sal_uInt32 nLen(8);
...@@ -1924,7 +1924,24 @@ void SvxPreviewBase::LocalPrePaint() ...@@ -1924,7 +1924,24 @@ void SvxPreviewBase::LocalPrePaint()
mpBufferDevice->SetMapMode(GetMapMode()); 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() void SvxPreviewBase::LocalPostPaint()
......
...@@ -304,7 +304,7 @@ void drawTransparenceBackground(OutputDevice& rOut, const Point& rPos, const Siz ...@@ -304,7 +304,7 @@ void drawTransparenceBackground(OutputDevice& rOut, const Point& rPos, const Siz
{ {
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) if(rStyleSettings.GetPreviewUsesCheckeredBackground())
{ {
// draw checkered background // draw checkered background
static const sal_uInt32 nLen(8); static const sal_uInt32 nLen(8);
......
...@@ -137,7 +137,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId) ...@@ -137,7 +137,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
aVDev.SetOutputSizePixel(aSize); aVDev.SetOutputSizePixel(aSize);
if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) if(rStyleSettings.GetPreviewUsesCheckeredBackground())
{ {
static const sal_uInt32 nLen(8); static const sal_uInt32 nLen(8);
static const Color aW(COL_WHITE); static const Color aW(COL_WHITE);
......
...@@ -205,7 +205,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash) ...@@ -205,7 +205,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash)
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
: DRAWMODE_DEFAULT); : DRAWMODE_DEFAULT);
if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) if(rStyleSettings.GetPreviewUsesCheckeredBackground())
{ {
const Point aNull(0, 0); const Point aNull(0, 0);
static const sal_uInt32 nLen(8 * nFactor); static const sal_uInt32 nLen(8 * nFactor);
......
...@@ -207,7 +207,7 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex ) ...@@ -207,7 +207,7 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex )
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
: DRAWMODE_DEFAULT); : DRAWMODE_DEFAULT);
if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) if(rStyleSettings.GetPreviewUsesCheckeredBackground())
{ {
const Point aNull(0, 0); const Point aNull(0, 0);
static const sal_uInt32 nLen(8); static const sal_uInt32 nLen(8);
......
...@@ -194,7 +194,7 @@ Bitmap XLineEndList::CreateBitmapForUI( long nIndex ) ...@@ -194,7 +194,7 @@ Bitmap XLineEndList::CreateBitmapForUI( long nIndex )
? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ? DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT
: DRAWMODE_DEFAULT); : DRAWMODE_DEFAULT);
if(rStyleSettings.GetUIPreviewUsesCheckeredBackground()) if(rStyleSettings.GetPreviewUsesCheckeredBackground())
{ {
const Point aNull(0, 0); const Point aNull(0, 0);
static const sal_uInt32 nLen(8); static const sal_uInt32 nLen(8);
......
...@@ -440,7 +440,7 @@ private: ...@@ -440,7 +440,7 @@ private:
Size maListBoxPreviewDefaultLogicSize; Size maListBoxPreviewDefaultLogicSize;
Size maListBoxPreviewDefaultPixelSize; Size maListBoxPreviewDefaultPixelSize;
sal_uInt16 mnListBoxPreviewDefaultLineWidth; sal_uInt16 mnListBoxPreviewDefaultLineWidth;
sal_Bool mbUIPreviewUsesCheckeredBackground; sal_Bool mbPreviewUsesCheckeredBackground;
}; };
#define DEFAULT_WORKSPACE_GRADIENT_START_COLOR Color( 0xa3, 0xae, 0xb8 ) #define DEFAULT_WORKSPACE_GRADIENT_START_COLOR Color( 0xa3, 0xae, 0xb8 )
...@@ -972,8 +972,8 @@ public: ...@@ -972,8 +972,8 @@ public:
// defines if previews which containn potentially transparent objects (e.g. the dash/line/LineStartEnd previews and others) // 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 // 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; } void SetPreviewUsesCheckeredBackground(bool bNew) { CopyData(); mpData->mbPreviewUsesCheckeredBackground = bNew; }
bool GetUIPreviewUsesCheckeredBackground() const { return mpData->mbUIPreviewUsesCheckeredBackground; } bool GetPreviewUsesCheckeredBackground() const { return mpData->mbPreviewUsesCheckeredBackground; }
void SetStandardStyles(); void SetStandardStyles();
......
...@@ -441,7 +441,7 @@ ImplStyleData::ImplStyleData() ...@@ -441,7 +441,7 @@ ImplStyleData::ImplStyleData()
maListBoxPreviewDefaultLogicSize = Size(15, 7); maListBoxPreviewDefaultLogicSize = Size(15, 7);
maListBoxPreviewDefaultPixelSize = Size(0, 0); // on-demand calculated in GetListBoxPreviewDefaultPixelSize() maListBoxPreviewDefaultPixelSize = Size(0, 0); // on-demand calculated in GetListBoxPreviewDefaultPixelSize()
mnListBoxPreviewDefaultLineWidth = 1; mnListBoxPreviewDefaultLineWidth = 1;
mbUIPreviewUsesCheckeredBackground = true; mbPreviewUsesCheckeredBackground = true;
SetStandardStyles(); SetStandardStyles();
} }
...@@ -554,7 +554,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : ...@@ -554,7 +554,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
maListBoxPreviewDefaultLogicSize = rData.maListBoxPreviewDefaultLogicSize; maListBoxPreviewDefaultLogicSize = rData.maListBoxPreviewDefaultLogicSize;
maListBoxPreviewDefaultPixelSize = rData.maListBoxPreviewDefaultPixelSize; maListBoxPreviewDefaultPixelSize = rData.maListBoxPreviewDefaultPixelSize;
mnListBoxPreviewDefaultLineWidth = rData.mnListBoxPreviewDefaultLineWidth; mnListBoxPreviewDefaultLineWidth = rData.mnListBoxPreviewDefaultLineWidth;
mbUIPreviewUsesCheckeredBackground = rData.mbUIPreviewUsesCheckeredBackground; mbPreviewUsesCheckeredBackground = rData.mbPreviewUsesCheckeredBackground;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -1075,7 +1075,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const ...@@ -1075,7 +1075,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->maListBoxPreviewDefaultLogicSize == rSet.mpData->maListBoxPreviewDefaultLogicSize) && (mpData->maListBoxPreviewDefaultLogicSize == rSet.mpData->maListBoxPreviewDefaultLogicSize) &&
(mpData->maListBoxPreviewDefaultPixelSize == rSet.mpData->maListBoxPreviewDefaultPixelSize) && (mpData->maListBoxPreviewDefaultPixelSize == rSet.mpData->maListBoxPreviewDefaultPixelSize) &&
(mpData->mnListBoxPreviewDefaultLineWidth == rSet.mpData->mnListBoxPreviewDefaultLineWidth) && (mpData->mnListBoxPreviewDefaultLineWidth == rSet.mpData->mnListBoxPreviewDefaultLineWidth) &&
(mpData->mbUIPreviewUsesCheckeredBackground == rSet.mpData->mbUIPreviewUsesCheckeredBackground)) (mpData->mbPreviewUsesCheckeredBackground == rSet.mpData->mbPreviewUsesCheckeredBackground))
return sal_True; return sal_True;
else else
return sal_False; return sal_False;
......
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