From 0acdeacbe774b7e05323ad80b556e7102a083192 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 31 Jul 2013 17:27:43 +0100 Subject: 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 --- .../registry/schema/org/openoffice/Office/Common.xcs | 2 +- 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. - true + false 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 ); -- cgit v1.2.3