summaryrefslogtreecommitdiff
path: root/vcl/source/app/IconThemeSelector.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-14 13:49:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-14 13:50:37 +0000
commit6e32e575829160b3c51ebbb67231baec7135afd3 (patch)
tree748090363b848a47d7931684c4eb07593678c841 /vcl/source/app/IconThemeSelector.cxx
parent32d0378284a42f0eba1df92555767a43be079117 (diff)
Resolves: tdf#103915 when global dark theme is set fall back to breeze_dark
otherwise don't assume a desired iconset ending in *dark means breeze_dark is a good fallback Change-Id: Ia294a86e17a2c390b503d5200dfc7195759afa00
Diffstat (limited to 'vcl/source/app/IconThemeSelector.cxx')
-rw-r--r--vcl/source/app/IconThemeSelector.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx
index 556d31a260a0..95ee517b6f21 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -43,7 +43,8 @@ bool icon_theme_is_in_installed_themes(const OUString& theme,
} // end anonymous namespace
IconThemeSelector::IconThemeSelector()
-: mUseHighContrastTheme(false)
+ : mUseHighContrastTheme(false)
+ , mPreferDarkIconTheme(false)
{
}
@@ -83,7 +84,7 @@ IconThemeSelector::SelectIconThemeForDesktopEnvironment(
return mPreferredIconTheme;
}
//if a dark variant is preferred, and we didn't have an exact match, then try our one and only dark theme
- if (mPreferredIconTheme.endsWith("_dark") && icon_theme_is_in_installed_themes("breeze_dark", installedThemes)) {
+ if (mPreferDarkIconTheme && icon_theme_is_in_installed_themes("breeze_dark", installedThemes)) {
return OUString("breeze_dark");
}
}
@@ -121,9 +122,10 @@ IconThemeSelector::SetUseHighContrastTheme(bool v)
}
void
-IconThemeSelector::SetPreferredIconTheme(const OUString& theme)
+IconThemeSelector::SetPreferredIconTheme(const OUString& theme, bool bDarkIconTheme)
{
mPreferredIconTheme = theme;
+ mPreferDarkIconTheme = bDarkIconTheme;
}
bool
@@ -135,6 +137,9 @@ IconThemeSelector::operator==(const vcl::IconThemeSelector& other) const
if (mPreferredIconTheme != other.mPreferredIconTheme) {
return false;
}
+ if (mPreferDarkIconTheme != other.mPreferDarkIconTheme) {
+ return false;
+ }
if (mUseHighContrastTheme != other.mUseHighContrastTheme) {
return false;
}