diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-01-27 18:20:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-01-27 18:20:59 +0300 |
commit | 19e3c0f6b80b41e1dca65899053590f59952e3fb (patch) | |
tree | 547cdc99ec11ce74d674b22003ca8927891d67a4 /src/gui | |
parent | 6917c126fbee146183433367be9a3d8fef94a1dd (diff) | |
download | manaverse-19e3c0f6b80b41e1dca65899053590f59952e3fb.tar.gz manaverse-19e3c0f6b80b41e1dca65899053590f59952e3fb.tar.bz2 manaverse-19e3c0f6b80b41e1dca65899053590f59952e3fb.tar.xz manaverse-19e3c0f6b80b41e1dca65899053590f59952e3fb.zip |
Move color names into separate file.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 44 | ||||
-rw-r--r-- | src/gui/widgets/browserbox.h | 18 |
2 files changed, 24 insertions, 38 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index e1bb330e4..c57a9bf4c 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -96,8 +96,8 @@ ImageSet *BrowserBox::mEmotes = nullptr; int BrowserBox::mInstances = 0; #define readColor(color) \ - mColors[0][color] = getThemeColor(ThemeColorId::color); \ - mColors[1][color] = getThemeColor(ThemeColorId::color##_OUTLINE) + mColors[0][ColorName::color] = getThemeColor(ThemeColorId::color); \ + mColors[1][ColorName::color] = getThemeColor(ThemeColorId::color##_OUTLINE) BrowserBox::BrowserBox(const Widget2 *const widget, const BrowserBoxModeT mode, @@ -778,44 +778,44 @@ int BrowserBox::calcHeight() switch (c) { case '0': - selColor[0] = mColors[0][BLACK]; - selColor[1] = mColors[1][BLACK]; + selColor[0] = mColors[0][ColorName::BLACK]; + selColor[1] = mColors[1][ColorName::BLACK]; break; case '1': - selColor[0] = mColors[0][RED]; - selColor[1] = mColors[1][RED]; + selColor[0] = mColors[0][ColorName::RED]; + selColor[1] = mColors[1][ColorName::RED]; break; case '2': - selColor[0] = mColors[0][GREEN]; - selColor[1] = mColors[1][GREEN]; + selColor[0] = mColors[0][ColorName::GREEN]; + selColor[1] = mColors[1][ColorName::GREEN]; break; case '3': - selColor[0] = mColors[0][BLUE]; - selColor[1] = mColors[1][BLUE]; + selColor[0] = mColors[0][ColorName::BLUE]; + selColor[1] = mColors[1][ColorName::BLUE]; break; case '4': - selColor[0] = mColors[0][ORANGE]; - selColor[1] = mColors[1][ORANGE]; + selColor[0] = mColors[0][ColorName::ORANGE]; + selColor[1] = mColors[1][ColorName::ORANGE]; break; case '5': - selColor[0] = mColors[0][YELLOW]; - selColor[1] = mColors[1][YELLOW]; + selColor[0] = mColors[0][ColorName::YELLOW]; + selColor[1] = mColors[1][ColorName::YELLOW]; break; case '6': - selColor[0] = mColors[0][PINK]; - selColor[1] = mColors[1][PINK]; + selColor[0] = mColors[0][ColorName::PINK]; + selColor[1] = mColors[1][ColorName::PINK]; break; case '7': - selColor[0] = mColors[0][PURPLE]; - selColor[1] = mColors[1][PURPLE]; + selColor[0] = mColors[0][ColorName::PURPLE]; + selColor[1] = mColors[1][ColorName::PURPLE]; break; case '8': - selColor[0] = mColors[0][GRAY]; - selColor[1] = mColors[1][GRAY]; + selColor[0] = mColors[0][ColorName::GRAY]; + selColor[1] = mColors[1][ColorName::GRAY]; break; case '9': - selColor[0] = mColors[0][BROWN]; - selColor[1] = mColors[1][BROWN]; + selColor[0] = mColors[0][ColorName::BROWN]; + selColor[1] = mColors[1][ColorName::BROWN]; break; default: selColor[0] = textColor[0]; diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index fe0c0c36d..aa5a70b0e 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -29,6 +29,7 @@ #include "enums/simpletypes/opaque.h" #include "enums/gui/browserboxmode.h" +#include "enums/gui/colorname.h" #include "gui/browserlink.h" @@ -114,21 +115,6 @@ class BrowserBox final : public Widget, void updateHeight(); - enum - { - RED = 0, - BLACK, - GREEN, - BLUE, - ORANGE, - YELLOW, - PINK, - PURPLE, - GRAY, - BROWN, - COLORS_MAX - }; - typedef std::list<std::string> TextRows; TextRows &getRows() noexcept2 A_WARN_UNUSED @@ -203,7 +189,7 @@ class BrowserBox final : public Widget, Color mHighlightColor; Color mHyperLinkColor; - Color mColors[2][COLORS_MAX]; + Color mColors[2][ColorName::COLORS_MAX]; Opaque mOpaque; bool mUseLinksAndUserColors; |