summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-01 04:58:53 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-01 04:58:53 +0300
commit454142ae5763c3b4ce86d26bdf28001abb3b20b5 (patch)
tree74d2b5961a82d6d33bbb5cdbe5e30ab8ce35a62e /src/gui
parent51a231c22425db9eeda38889deda3b07dcdd6924 (diff)
downloadplus-454142ae5763c3b4ce86d26bdf28001abb3b20b5.tar.gz
plus-454142ae5763c3b4ce86d26bdf28001abb3b20b5.tar.bz2
plus-454142ae5763c3b4ce86d26bdf28001abb3b20b5.tar.xz
plus-454142ae5763c3b4ce86d26bdf28001abb3b20b5.zip
Use const theme id parameter in Theme::getColor.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/theme.h16
1 files changed, 11 insertions, 5 deletions
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,