diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-07-31 17:27:43 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-08-06 16:53:22 +0200 |
commit | 0acdeacbe774b7e05323ad80b556e7102a083192 (patch) | |
tree | fb5c02c2a5bfc62013a92ed5b34adba9004fadd6 | |
parent | 022da4ea298d5d5c134c374546d963926dae2b37 (diff) |
Disable auto-detection of high-contrast mode by default
Lots of Linux themes are rather 'black' anyway, and yet want the
icon set they selected and the colours too. If this is needed it
can still be forced either by changing the setting back, changing
the setting back in the UI, and/or exporting SAL_FORCE_HC=1
Change-Id: Ia034942db7ec2fdd27b4a0b43f2f19269e05f5c6
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index cc6da7d4f867..64661b5cd923 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -6138,7 +6138,7 @@ implicitly, which is recognized if the option is set.</desc> <label>detect system's high contrast</label> </info> - <value>true</value> + <value>false</value> </prop> <prop oor:name="IsForPagePreviews" oor:type="xs:boolean" oor:nillable="false"> <info> diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index aa3db23122f9..5a7d571f463c 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -625,6 +625,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl rSettings.SetStyleSettings( aStyleSettings ); + bool bForceHCMode = false; + // auto detect HC mode; if the system already set it to "yes" // (see above) then accept that if( !rSettings.GetStyleSettings().GetHighContrastMode() ) @@ -641,20 +643,19 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl } if( bAutoHCMode ) { - if( rSettings.GetStyleSettings().GetFaceColor().IsDark() - || rSettings.GetStyleSettings().GetWindowColor().IsDark() ) - { - aStyleSettings = rSettings.GetStyleSettings(); - aStyleSettings.SetHighContrastMode( sal_True ); - aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST ); - rSettings.SetStyleSettings( aStyleSettings ); - } + if( rSettings.GetStyleSettings().GetFaceColor().IsDark() || + rSettings.GetStyleSettings().GetWindowColor().IsDark() ) + bForceHCMode = true; } } static const char* pEnvHC = getenv( "SAL_FORCE_HC" ); if( pEnvHC && *pEnvHC ) + bForceHCMode = true; + + if( bForceHCMode ) { + aStyleSettings = rSettings.GetStyleSettings(); aStyleSettings.SetHighContrastMode( sal_True ); aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST ); rSettings.SetStyleSettings( aStyleSettings ); |