summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorSahil Gautam <sahil.gautam.extern@allotropia.de>2025-01-07 10:43:29 +0530
committerMike Kaganski <mike.kaganski@collabora.com>2025-01-07 12:24:40 +0100
commit242b8a9540f8e019dbe82c11d989d20d3a0f0ea7 (patch)
tree9f86db80478f4f971e9be7a74151287f008a65df /cui/source
parent6929168584be46583ae033c3b82574f743490c4c (diff)
tdf#164393 [API CHANGE] ThemeColors refactor part 3
- add functions like IsThemeEnabled(), IsThemeDisabled(), GetThemeState(), SetThemeState() to check/change registry (theme state) values so that code outside ThemeColors class remains unaffected from any API changes, and use enums like ENABLED and DISABLED to represent int values from registry. Change-Id: I6067cb5b0fa40d6c038e398229ef8ba93d26ca92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179404 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/options/appearance.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/cui/source/options/appearance.cxx b/cui/source/options/appearance.cxx
index fa70705ab327..f36c6255809e 100644
--- a/cui/source/options/appearance.cxx
+++ b/cui/source/options/appearance.cxx
@@ -21,6 +21,7 @@
#include <tools/debug.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/themecolors.hxx>
#include <comphelper/dispatchcommand.hxx>
#include <comphelper/propertyvalue.hxx>
#include <map>
@@ -196,11 +197,10 @@ bool SvxAppearanceTabPage::FillItemSet(SfxItemSet* /* rSet */)
// commit LibreOfficeTheme, enable it if the current scheme is not Automatic
if (m_xSchemeList->get_value_changed_from_saved())
{
- bool bIsLibreOfficeThemeEnabled = m_xSchemeList->get_active_id() != AUTOMATIC_COLOR_SCHEME;
- auto pChange(comphelper::ConfigurationChanges::create());
- officecfg::Office::Common::Appearance::LibreOfficeTheme::set(bIsLibreOfficeThemeEnabled,
- pChange);
- pChange->commit();
+ ThemeState eLibreOfficeThemeState = m_xSchemeList->get_active_id() != AUTOMATIC_COLOR_SCHEME
+ ? ThemeState::ENABLED
+ : ThemeState::DISABLED;
+ ThemeColors::SetThemeState(eLibreOfficeThemeState);
}
return true;