Kaydet (Commit) 60446a03 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Caolán McNamara

Related: #i122120# corrected flag for drawing checkerboards...

adapted previews, added to configuration

(cherry picked from commit c17e634e)

Conflicts:
	officecfg/registry/schema/org/openoffice/Office/Common.xcs
	svtools/inc/svtools/accessibilityoptions.hxx
	svtools/source/inc/configitems/accessibilityoptions_const.hxx
	vcl/inc/vcl/settings.hxx

Change-Id: I3f4fd9525e31cd816599b963ecd2fa42b1f666d7
üst 72703332
...@@ -62,6 +62,10 @@ public: ...@@ -62,6 +62,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);
...@@ -75,6 +79,7 @@ public: ...@@ -75,6 +79,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();
......
...@@ -360,7 +360,7 @@ private: ...@@ -360,7 +360,7 @@ private:
Size maListBoxPreviewDefaultLogicSize; Size maListBoxPreviewDefaultLogicSize;
Size maListBoxPreviewDefaultPixelSize; Size maListBoxPreviewDefaultPixelSize;
sal_uInt16 mnListBoxPreviewDefaultLineWidth; sal_uInt16 mnListBoxPreviewDefaultLineWidth;
sal_Bool mbUIPreviewUsesCheckeredBackground; sal_Bool mbPreviewUsesCheckeredBackground;
OUString maPersonaHeaderFooter; ///< Cache the settings to detect changes. OUString maPersonaHeaderFooter; ///< Cache the settings to detect changes.
...@@ -935,8 +935,8 @@ public: ...@@ -935,8 +935,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();
......
...@@ -6262,6 +6262,19 @@ ...@@ -6262,6 +6262,19 @@
</info> </info>
<value>8</value> <value>8</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>
<group oor:name="ExternalApps" oor:extensible="true"> <group oor:name="ExternalApps" oor:extensible="true">
<info> <info>
......
...@@ -59,6 +59,7 @@ namespace ...@@ -59,6 +59,7 @@ namespace
const char s_sColorValueSetColumnCount[] = "ColorValueSetColumnCount"; const char s_sColorValueSetColumnCount[] = "ColorValueSetColumnCount";
const char s_sEdgeBlending[] = "EdgeBlending"; const char s_sEdgeBlending[] = "EdgeBlending";
const char s_sListBoxMaximumLineCount[] = "ListBoxMaximumLineCount"; const char s_sListBoxMaximumLineCount[] = "ListBoxMaximumLineCount";
const char s_sPreviewUsesCheckeredBackground[] = "PreviewUsesCheckeredBackground";
} }
// class SvtAccessibilityOptions_Impl --------------------------------------------- // class SvtAccessibilityOptions_Impl ---------------------------------------------
...@@ -86,6 +87,7 @@ public: ...@@ -86,6 +87,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);
...@@ -99,6 +101,7 @@ public: ...@@ -99,6 +101,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; };
}; };
...@@ -357,6 +360,24 @@ sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const ...@@ -357,6 +360,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)
{
SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
}
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);
...@@ -583,6 +604,14 @@ void SvtAccessibilityOptions_Impl::SetVCLSettings() ...@@ -583,6 +604,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);
...@@ -652,6 +681,26 @@ void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet) ...@@ -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 -------------------------------------------------- // class SvtAccessibilityOptions --------------------------------------------------
...@@ -756,6 +805,10 @@ sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const ...@@ -756,6 +805,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)
...@@ -810,6 +863,10 @@ void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet) ...@@ -810,6 +863,10 @@ void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet)
{ {
sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet); sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet);
} }
void SvtAccessibilityOptions::SetPreviewUsesCheckeredBackground(sal_Bool bSet)
{
sm_pSingleImplConfig->SetPreviewUsesCheckeredBackground(bSet);
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
...@@ -1209,7 +1209,7 @@ namespace ...@@ -1209,7 +1209,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);
...@@ -1635,7 +1635,24 @@ void SvxPreviewBase::LocalPrePaint() ...@@ -1635,7 +1635,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()
......
...@@ -262,7 +262,7 @@ void drawTransparenceBackground(OutputDevice& rOut, const Point& rPos, const Siz ...@@ -262,7 +262,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);
......
...@@ -130,7 +130,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId) ...@@ -130,7 +130,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);
......
...@@ -146,7 +146,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash) ...@@ -146,7 +146,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);
......
...@@ -150,7 +150,7 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex ) ...@@ -150,7 +150,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);
......
...@@ -131,7 +131,7 @@ Bitmap XLineEndList::CreateBitmapForUI( long nIndex ) ...@@ -131,7 +131,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);
......
...@@ -243,7 +243,7 @@ ImplStyleData::ImplStyleData() : ...@@ -243,7 +243,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();
} }
...@@ -367,7 +367,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : ...@@ -367,7 +367,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;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -985,7 +985,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const ...@@ -985,7 +985,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