summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-11-10 17:57:19 +0000
committerJan Holesovsky <kendy@collabora.com>2017-11-16 14:02:59 +0100
commit07ee9335d0be1a2bfe2d39bd5b9fd3fef715e3dd (patch)
treeda94e0ef0e8066538f3e45d212c7023a18039a8d
parent7dcc0a3333debe3d86e03931a3329daf64cf5023 (diff)
vcl: StyleSettings - start to unwind code duplication.
This should be a pure re-factor, plus headless tweak. Change-Id: Iad7f524ea76625601b3f85cc13a50311ed1de171 Reviewed-on: https://gerrit.libreoffice.org/44811 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--include/vcl/settings.hxx4
-rw-r--r--vcl/headless/svpframe.cxx8
-rw-r--r--vcl/source/app/settings.cxx13
3 files changed, 24 insertions, 1 deletions
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index e8b7c0a6f28a..ffa39ad7c1c5 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -605,6 +605,10 @@ public:
bool operator ==( const StyleSettings& rSet ) const;
bool operator !=( const StyleSettings& rSet ) const;
+
+ // Batch setters used by various backends
+ void BatchSetBackgrounds( const Color &aBackColor,
+ bool bCheckedColorSpecialCase = true);
};
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 0ce76cf119d1..6db9d3b2e350 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -409,8 +409,14 @@ LanguageType SvpSalFrame::GetInputLanguage()
return LANGUAGE_DONTKNOW;
}
-void SvpSalFrame::UpdateSettings( AllSettings& )
+void SvpSalFrame::UpdateSettings( AllSettings& rSettings )
{
+ StyleSettings aStyleSettings = rSettings.GetStyleSettings();
+
+ Color aBackgroundColor( 0xec, 0xec, 0xec );
+ aStyleSettings.BatchSetBackgrounds( aBackgroundColor, false );
+
+ rSettings.SetStyleSettings( aStyleSettings );
}
void SvpSalFrame::Beep()
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index e4d90f91e253..69848d3f530c 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -3112,4 +3112,17 @@ AllSettings::GetSysLocale()
return mxData->maSysLocale;
}
+
+void StyleSettings::BatchSetBackgrounds( const Color &aBackColor,
+ bool bCheckedColorSpecialCase )
+{
+ Set3DColors( aBackColor );
+ SetFaceColor( aBackColor );
+ SetDialogColor( aBackColor );
+ SetWorkspaceColor( aBackColor );
+
+ if (bCheckedColorSpecialCase)
+ SetCheckedColorSpecialCase();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */