diff options
Diffstat (limited to 'src/gui/widgets/widget2.h')
-rw-r--r-- | src/gui/widgets/widget2.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index 68a45ae30..0bf7ae87a 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -21,12 +21,43 @@ #ifndef GUI_WIDGET2_H #define GUI_WIDGET2_H +#include "gui/theme.h" + class Widget2 { public: - Widget2(); + Widget2() + { + } + + ~Widget2() + { + } + + inline const gcn::Color &getThemeColor(const int type, + const int alpha = 255) + { + return Theme::getThemeColor(type * mPalette, alpha); + } + + inline const gcn::Color &getThemeCharColor(const signed char c, + bool &valid) + { + const int colorId = Theme::getIdByChar(c, valid); + if (valid) + return Theme::getThemeColor(colorId * mPalette); + else + return Palette::BLACK; + } + + void setPalette(int p) + { + if (p >= 1 && p <= THEME_PALETTES) + mPalette = p; + } - ~Widget2(); + private: + int mPalette; }; #endif |