summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-10-07 20:00:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-10-08 17:34:34 +0200
commitd6dff5e96afc214baf11a3a41932b1432689b02e (patch)
tree75b9f432290eb41f6c754cc97301fe13ff9c9151 /vcl/source/app
parent2fccedec09c98d4a1c23ae831ce43db0dd936052 (diff)
tdf#124672 for hicontrast white/black bg select either Sifr vs Sifr Dark
Change-Id: I63d789d90bfad9fe57ceee2011797f611a2ac8cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141091 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/IconThemeSelector.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx
index 5abb7b29d5df..fd32008d9414 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -11,7 +11,10 @@
#include <IconThemeSelector.hxx>
+#include <tools/color.hxx>
#include <vcl/IconThemeInfo.hxx>
+#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
#include <config_mpl.h>
#include <algorithm>
@@ -106,8 +109,11 @@ IconThemeSelector::SelectIconTheme(
const OUString& theme) const
{
if (mUseHighContrastTheme) {
- if (icon_theme_is_in_installed_themes(IconThemeInfo::HIGH_CONTRAST_ID, installedThemes)) {
- return IconThemeInfo::HIGH_CONTRAST_ID;
+ const Color aCol(Application::GetSettings().GetStyleSettings().GetWindowColor());
+ const OUString name(aCol.IsDark() ? OUString(IconThemeInfo::HIGH_CONTRAST_ID_DARK)
+ : OUString(IconThemeInfo::HIGH_CONTRAST_ID_BRIGHT));
+ if (icon_theme_is_in_installed_themes(name, installedThemes)) {
+ return name;
}
}