summaryrefslogtreecommitdiff
path: root/desktop/qa/desktop_lib
diff options
context:
space:
mode:
authorSahil Gautam <sahil.gautam.extern@allotropia.de>2024-12-01 18:49:36 +0530
committerSahil Gautam <sahil.gautam.extern@allotropia.de>2024-12-18 16:24:08 +0100
commitddeeca35d9630f2d3d3afb83a2ec8f21458f6e19 (patch)
treec1df2f2b3f0d89565cee7814d878742295d355ea /desktop/qa/desktop_lib
parentc4962247e40b5e6750c522d43359d9436dcfec68 (diff)
tdf#163620 [API CHANGE] Add UI for libreoffice themes
Instead of Color, we have Light and Dark in the registry. So each theme extension will specify dark and light color values for each "customizable element" like DocColor etc. Under appearance we have three radio buttons - light/dark/system. If system is selected then light/dark colors are switched based on the system's theme. if explicitly light/dark is selected - that color is used from the registry. ColorConfigValue now has three entries nColor, nLightColor, nDarkColor. nColor is used as a cache for the color being used at the moment. This is to avoid otherwise expensive function calls + hundreds of modifications in the codebase just to change nColor. nColor is cached either when the theme is loaded or when changes are committed in `ColorConfig_Impl::ImplCommit()`. Now, if Automatic theme is selected then themes is disabled and the application uses the system colors. If some other scheme is selected like "CustomTheme" etc, then LibreOffice themes/UI color customization is enabled and the theme colors are used. Instead of a scroll window, now we have a combobox for the registry entries and a single color dropdown to select the color value. This color dropdown is for convinience in case the user wants to change some specific color that's bothering him. For themeing, theme extensions should be used. API CHANGE + remove Color in favour of Light and Dark + AppBackground has additional two - BackgroundType and Bitmap + remove officecfg::Office::Common::Misc::Appearnce in favor of officecfg::Office::Common::Appearance::ApplicationAppearance + move LibreofficeTheme under officecfg::Office::Common::Appearance UI + it looks like https://i.imgur.com/UMxjfuC.png which is a little different from how the [mockup] on the ticket describes it, and that's because of lack of time due to upcomming feature freeze. + system/light/dark allow the user to switch between light/dark modes based on either the system theme (system) or by manually specifying light/dark. + ui themeing and color customization is disabled when automatic theme is selected, and enabled otherwise. [mockup]: https://bug-attachments.documentfoundation.org/attachment.cgi?id=197469 Change-Id: I1a7f70dfe44b81f863814f87e8d46e146c0e3d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174835 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Sahil Gautam <sahil.gautam.extern@allotropia.de>
Diffstat (limited to 'desktop/qa/desktop_lib')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 11db3d75398b..7bca2926e948 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2270,7 +2270,9 @@ void DesktopLOKTest::testPaintPartTileDifferentSchemes()
svtools::EditableColorConfig aColorConfig;
svtools::ColorConfigValue aValue;
aValue.bIsVisible = true;
- aValue.nColor = aDarkColor;
+ // aValue.nColor is just used for cache. please see Change: I1a7f70dfe44b81f863814f87e8d46e146c0e3d5a
+ aValue.nLightColor = aDarkColor;
+ aValue.nDarkColor = aDarkColor;
aColorConfig.SetColorValue(svtools::DOCCOLOR, aValue);
aColorConfig.AddScheme(u"Dark"_ustr);
}
@@ -2280,7 +2282,8 @@ void DesktopLOKTest::testPaintPartTileDifferentSchemes()
svtools::EditableColorConfig aColorConfig;
svtools::ColorConfigValue aValue;
aValue.bIsVisible = true;
- aValue.nColor = COL_WHITE;
+ aValue.nLightColor = COL_WHITE;
+ aValue.nDarkColor = COL_WHITE;
aColorConfig.SetColorValue(svtools::DOCCOLOR, aValue);
aColorConfig.AddScheme(u"Light"_ustr);
}