From 454142ae5763c3b4ce86d26bdf28001abb3b20b5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 1 Apr 2018 04:58:53 +0300 Subject: Use const theme id parameter in Theme::getColor. --- src/gui/theme.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/theme.h b/src/gui/theme.h index f29db0c73..770e2ab3e 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -132,7 +132,7 @@ class Theme final : public Palette, * * @return the requested color */ - inline const Color &getColor(ThemeColorIdT type, + inline const Color &getColor(const ThemeColorIdT type, const unsigned int alpha) A_WARN_UNUSED { if (CAST_SIZE(type) >= mColors.size()) @@ -140,11 +140,17 @@ class Theme final : public Palette, logger->log("incorrect color request type: %d from %u", CAST_S32(type), CAST_U32(mColors.size())); - type = ThemeColorId::BROWSERBOX; + Color *const col = &mColors[CAST_SIZE( + ThemeColorId::BROWSERBOX)].color; + col->a = alpha; + return *col; + } + else + { + Color *const col = &mColors[CAST_SIZE(type)].color; + col->a = alpha; + return *col; } - Color *const col = &mColors[CAST_SIZE(type)].color; - col->a = alpha; - return *col; } ThemeColorIdT getIdByChar(const signed char c, -- cgit v1.2.3-70-g09d2