diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/widget2.cpp | 31 | ||||
-rw-r--r-- | src/gui/widgets/widget2.h | 35 |
3 files changed, 34 insertions, 34 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 7d6dc3f13..f8f3de2a0 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -499,7 +499,7 @@ int BrowserBox::calcHeight() const signed char c = row.at(start + 2); bool valid; - const gcn::Color col = Theme::getThemeColor(c, valid); + const gcn::Color col = Theme::getThemeCharColor(c, valid); if (c == '>') { diff --git a/src/gui/widgets/widget2.cpp b/src/gui/widgets/widget2.cpp deleted file mode 100644 index 6b38b0cf5..000000000 --- a/src/gui/widgets/widget2.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "gui/widgets/widget2.h" - -#include "debug.h" - -Widget2::Widget2() -{ -} - -Widget2::~Widget2() -{ -} 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 |