include/vcl/settings.hxx | 3 --- sfx2/source/appl/appserv.cxx | 6 +++--- vcl/osx/salframe.cxx | 2 +- vcl/source/app/settings.cxx | 12 ------------ vcl/win/gdi/salnativewidgets-luna.cxx | 2 +- vcl/win/window/salframe.cxx | 2 +- 6 files changed, 6 insertions(+), 21 deletions(-)
New commits: commit ce0f1bee0596bdcf314b3c2ccd8b3ebdefc70557 Author: Sahil Gautam <sahil.gautam.ext...@allotropia.de> AuthorDate: Fri Jun 6 09:38:05 2025 +0530 Commit: Sahil Gautam <sahil.gautam.ext...@allotropia.de> CommitDate: Fri Jun 6 17:09:39 2025 +0200 tdf#164970 remove redundent wrapper functions over AppColorMode. these were relevant before themes rework when the document appearance and the application appearance were separate from each other. now they are interconnected, if the application is in dark mode, the document colors also change to dark, unless explicitly disabled in `Tools > Options > Appearance > Use white document background`. Change-Id: I928411f1acece1f375641119e8090f8d0389076b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186214 Tested-by: Jenkins Reviewed-by: Sahil Gautam <sahil.gautam.ext...@allotropia.de> diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 4d2b0d55cf17..d6203fe3e1e6 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -668,9 +668,6 @@ public: bool GetDisablePrinting() const; void SetEnableLocalizedDecimalSep( bool bEnable ); bool GetEnableLocalizedDecimalSep() const; - - static void SetDarkMode(AppearanceMode nMode); - static AppearanceMode GetDarkMode(); // return if dark mode is active, resolving 'auto' to dark (true) or light (false) static bool GetUseDarkMode(); static void SetAppColorMode(AppearanceMode nMode); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 9552c4733c47..25d5ee8b4519 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -716,14 +716,14 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // Set the UI theme. It would be nicest to use automatic whenever possible AppearanceMode eUseMode = AppearanceMode::AUTO; - if (MiscSettings::GetDarkMode() != AppearanceMode::AUTO) - MiscSettings::SetDarkMode(eUseMode); + if (MiscSettings::GetAppColorMode() != AppearanceMode::AUTO) + MiscSettings::SetAppColorMode(eUseMode); if (MiscSettings::GetUseDarkMode() == bWasInDarkMode) { // automatic didn't toggle, so force the desired theme eUseMode = bWasInDarkMode ? AppearanceMode::LIGHT : AppearanceMode::DARK; - MiscSettings::SetDarkMode(eUseMode); + MiscSettings::SetAppColorMode(eUseMode); } // Now set the document theme diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 34b6bdf783c6..a83c9907674b 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1456,7 +1456,7 @@ void AquaSalFrame::UpdateDarkMode() { NSAppearance *pCurrentAppearance = [NSApp appearance]; - switch (MiscSettings::GetDarkMode()) + switch (MiscSettings::GetAppColorMode()) { case AppearanceMode::AUTO: default: diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 138f15d413a2..7d8c63e07839 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2306,18 +2306,6 @@ bool MiscSettings::GetEnableLocalizedDecimalSep() const return mxData->mbEnableLocalizedDecimalSep; } -AppearanceMode MiscSettings::GetDarkMode() -{ - // MiscSettings::GetAppColorMode() replaces MiscSettings::GetDarkMode() - return MiscSettings::GetAppColorMode(); -} - -void MiscSettings::SetDarkMode(AppearanceMode eMode) -{ - // MiscSettings::SetAppColorMode() replaces MiscSettings::SetDarkMode() - MiscSettings::SetAppColorMode(eMode); -} - bool MiscSettings::GetUseDarkMode() { vcl::Window* pDefWindow = ImplGetDefaultWindow(); diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index 39a800b269bd..49111fa35bcf 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -414,7 +414,7 @@ bool UseDarkMode() return false; bool bRet(false); - switch (MiscSettings::GetDarkMode()) + switch (MiscSettings::GetAppColorMode()) { case AppearanceMode::AUTO: default: diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 6ddc60713383..342fffbefe46 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -268,7 +268,7 @@ static void UpdateDarkMode(HWND hWnd) auto SetPreferredAppMode = reinterpret_cast<SetPreferredAppMode_t>(GetProcAddress(hUxthemeLib, MAKEINTRESOURCEA(135))); if (SetPreferredAppMode) { - switch (MiscSettings::GetDarkMode()) + switch (MiscSettings::GetAppColorMode()) { case AppearanceMode::AUTO: SetPreferredAppMode(AllowDark);