diff options
author | Tobias Lippert <drtl@fastmail.fm> | 2015-02-21 21:39:45 +0100 |
---|---|---|
committer | Yousuf Philips <philipz85@hotmail.com> | 2015-05-27 12:24:21 +0000 |
commit | 2a0118a98fc39dfed56fb7904733f63f6a2d6fe8 (patch) | |
tree | e9237ec691edcf32ee8e444bb7888d7dbb182e8e /vcl/source | |
parent | 0cdab3fc10828233d202e064a175dc6442a4a473 (diff) |
tdf#88675 Fix display names for hicontrast and tango_testing
The special cases for the icon themes with the filenames
"images_hicontrast.zip" and "images_tango_testing.zip" are now handled.
They will be displayed as "High Contrast" and "Tango Testing"
respectively.
Change-Id: Ia3c2b8b57809db9c5ed132c42a412157e91b2599
Reviewed-on: https://gerrit.libreoffice.org/14574
Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/IconThemeInfo.cxx | 20 | ||||
-rw-r--r-- | vcl/source/app/IconThemeSelector.cxx | 7 |
2 files changed, 21 insertions, 6 deletions
diff --git a/vcl/source/app/IconThemeInfo.cxx b/vcl/source/app/IconThemeInfo.cxx index 9531bf493ffe..da07e2c6bf77 100644 --- a/vcl/source/app/IconThemeInfo.cxx +++ b/vcl/source/app/IconThemeInfo.cxx @@ -13,8 +13,17 @@ #include <stdexcept> #include <algorithm> +// constants for theme ids and display names. Only the theme id for hicontrast is used +// outside of this class and hence made public. + +const OUString vcl::IconThemeInfo::HIGH_CONTRAST_ID = "hicontrast"; + namespace { +static const OUString HIGH_CONTRAST_DISPLAY_NAME = "High Contrast"; +static const OUString TANGO_TESTING_ID = "tango_testing"; +static const OUString TANGO_TESTING_DISPLAY_NAME = "Tango Testing"; + OUString filename_from_url(const OUString& url) { @@ -26,7 +35,7 @@ filename_from_url(const OUString& url) return filename; } -} +} // end anonymous namespace namespace vcl { @@ -111,6 +120,14 @@ IconThemeInfo::ThemeIdToDisplayName(const OUString& themeId) throw std::runtime_error("IconThemeInfo::ThemeIdToDisplayName() called with invalid id."); } + // sepcial cases + if (themeId.equalsIgnoreAsciiCase(HIGH_CONTRAST_ID)) { + return HIGH_CONTRAST_DISPLAY_NAME; + } + else if (themeId.equalsIgnoreAsciiCase(TANGO_TESTING_ID)) { + return TANGO_TESTING_DISPLAY_NAME; + } + // make the first letter uppercase OUString r; sal_Unicode firstLetter = themeId[0]; @@ -121,6 +138,7 @@ IconThemeInfo::ThemeIdToDisplayName(const OUString& themeId) else { r = themeId; } + return r; } diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx index 1a31f4158e81..235ba1f1e838 100644 --- a/vcl/source/app/IconThemeSelector.cxx +++ b/vcl/source/app/IconThemeSelector.cxx @@ -17,9 +17,6 @@ namespace vcl { /*static*/ const OUString -IconThemeSelector::HIGH_CONTRAST_ICON_THEME_ID("hicontrast"); - -/*static*/ const OUString IconThemeSelector::FALLBACK_ICON_THEME_ID("tango"); namespace { @@ -99,8 +96,8 @@ IconThemeSelector::SelectIconTheme( const OUString& theme) const { if (mUseHighContrastTheme) { - if (icon_theme_is_in_installed_themes(HIGH_CONTRAST_ICON_THEME_ID, installedThemes)) { - return HIGH_CONTRAST_ICON_THEME_ID; + if (icon_theme_is_in_installed_themes(IconThemeInfo::HIGH_CONTRAST_ID, installedThemes)) { + return IconThemeInfo::HIGH_CONTRAST_ID; } } |