summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-19 21:02:14 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-20 13:55:42 +0300
commit213a21e4c079113e5822d2cf90802d6dcb2cb232 (patch)
tree9d3ae306575ef0dc5c3b8346673e2f246b5e427e /src/gui/widgets
parentc632452430cb3f886da38fa315cb27a3a3a10d2c (diff)
downloadmv-213a21e4c079113e5822d2cf90802d6dcb2cb232.tar.gz
mv-213a21e4c079113e5822d2cf90802d6dcb2cb232.tar.bz2
mv-213a21e4c079113e5822d2cf90802d6dcb2cb232.tar.xz
mv-213a21e4c079113e5822d2cf90802d6dcb2cb232.zip
In all controls, call Widget2 methods to get colors.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp4
-rw-r--r--src/gui/widgets/browserbox.cpp26
-rw-r--r--src/gui/widgets/button.cpp11
-rw-r--r--src/gui/widgets/checkbox.cpp2
-rw-r--r--src/gui/widgets/desktop.cpp7
-rw-r--r--src/gui/widgets/dropdown.cpp8
-rw-r--r--src/gui/widgets/dropshortcutcontainer.cpp4
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/guildchattab.cpp6
-rw-r--r--src/gui/widgets/guitable.cpp4
-rw-r--r--src/gui/widgets/itemcontainer.cpp4
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp6
-rw-r--r--src/gui/widgets/label.cpp2
-rw-r--r--src/gui/widgets/listbox.cpp4
-rw-r--r--src/gui/widgets/progressbar.cpp2
-rw-r--r--src/gui/widgets/radiobutton.cpp2
-rw-r--r--src/gui/widgets/shoplistbox.cpp16
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/tab.cpp10
-rw-r--r--src/gui/widgets/textbox.cpp2
-rw-r--r--src/gui/widgets/textfield.cpp4
-rw-r--r--src/gui/widgets/textpreview.cpp4
-rw-r--r--src/gui/widgets/whispertab.cpp12
-rw-r--r--src/gui/widgets/widget2.h7
-rw-r--r--src/gui/widgets/window.cpp2
25 files changed, 78 insertions, 75 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 486b6fd2e..b1eda9ed4 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -49,7 +49,7 @@ AvatarListBox::AvatarListBox(AvatarListModel *const model) :
ListBox(model),
mShowGender(config.getBoolValue("showgender")),
mShowLevel(config.getBoolValue("showlevel")),
- mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT))
+ mHighlightColor(getThemeColor(Theme::HIGHLIGHT))
{
instances++;
@@ -64,7 +64,7 @@ AvatarListBox::AvatarListBox(AvatarListModel *const model) :
config.addListener("showgender", this);
config.addListener("showlevel", this);
- mForegroundColor = Theme::getThemeColor(Theme::TEXT);
+ mForegroundColor = getThemeColor(Theme::TEXT);
}
AvatarListBox::~AvatarListBox()
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index f8f3de2a0..0f72ad649 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -63,23 +63,23 @@ BrowserBox::BrowserBox(const unsigned int mode, const bool opaque) :
mAlwaysUpdate(true),
mProcessVersion(false),
mEnableImages(false),
- mBackgroundColor(Theme::getThemeColor(Theme::BACKGROUND)),
- mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT)),
- mHyperLinkColor(Theme::getThemeColor(Theme::HYPERLINK))
+ mBackgroundColor(getThemeColor(Theme::BACKGROUND)),
+ mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
+ mHyperLinkColor(getThemeColor(Theme::HYPERLINK))
{
setFocusable(true);
addMouseListener(this);
- mColors[RED] = Theme::getThemeColor(Theme::RED);
- mColors[GREEN] = Theme::getThemeColor(Theme::GREEN);
- mColors[BLUE] = Theme::getThemeColor(Theme::BLUE);
- mColors[ORANGE] = Theme::getThemeColor(Theme::ORANGE);
- mColors[YELLOW] = Theme::getThemeColor(Theme::YELLOW);
- mColors[PINK] = Theme::getThemeColor(Theme::PINK);
- mColors[PURPLE] = Theme::getThemeColor(Theme::PURPLE);
- mColors[GRAY] = Theme::getThemeColor(Theme::GRAY);
- mColors[BROWN] = Theme::getThemeColor(Theme::BROWN);
- mForegroundColor = Theme::getThemeColor(Theme::BROWSERBOX);
+ mColors[RED] = getThemeColor(Theme::RED);
+ mColors[GREEN] = getThemeColor(Theme::GREEN);
+ mColors[BLUE] = getThemeColor(Theme::BLUE);
+ mColors[ORANGE] = getThemeColor(Theme::ORANGE);
+ mColors[YELLOW] = getThemeColor(Theme::YELLOW);
+ mColors[PINK] = getThemeColor(Theme::PINK);
+ mColors[PURPLE] = getThemeColor(Theme::PURPLE);
+ mColors[GRAY] = getThemeColor(Theme::GRAY);
+ mColors[BROWN] = getThemeColor(Theme::BROWN);
+ mForegroundColor = getThemeColor(Theme::BROWSERBOX);
}
BrowserBox::~BrowserBox()
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 2ea528a8e..9b0f0578f 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -66,6 +66,7 @@ Skin *Button::button[BUTTON_COUNT];
Button::Button() :
gcn::Button(),
+ Widget2(),
gcn::WidgetListener(),
mDescription(""), mClickCount(0),
mTag(0),
@@ -88,6 +89,7 @@ Button::Button() :
Button::Button(const std::string &caption, const std::string &actionEventId,
gcn::ActionListener *const listener) :
gcn::Button(caption),
+ Widget2(),
gcn::WidgetListener(),
mDescription(""),
mClickCount(0),
@@ -117,6 +119,7 @@ Button::Button(const std::string &caption, const std::string &imageName,
const std::string &actionEventId,
gcn::ActionListener *const listener) :
gcn::Button(caption),
+ Widget2(),
gcn::WidgetListener(),
mDescription(""),
mClickCount(0),
@@ -192,10 +195,10 @@ void Button::init()
updateAlpha();
}
- mEnabledColor = Theme::getThemeColor(Theme::BUTTON);
- mDisabledColor = Theme::getThemeColor(Theme::BUTTON_DISABLED);
- mHighlightedColor = Theme::getThemeColor(Theme::BUTTON_HIGHLIGHTED);
- mPressedColor = Theme::getThemeColor(Theme::BUTTON_PRESSED);
+ mEnabledColor = getThemeColor(Theme::BUTTON);
+ mDisabledColor = getThemeColor(Theme::BUTTON_DISABLED);
+ mHighlightedColor = getThemeColor(Theme::BUTTON_HIGHLIGHTED);
+ mPressedColor = getThemeColor(Theme::BUTTON_PRESSED);
mInstances++;
}
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index 8ffb4e7bb..71e718fed 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -70,7 +70,7 @@ CheckBox::CheckBox(const std::string &caption, const bool selected,
if (listener)
addActionListener(listener);
- mForegroundColor = Theme::getThemeColor(Theme::CHECKBOX);
+ mForegroundColor = getThemeColor(Theme::CHECKBOX);
if (mSkin)
{
mPadding = mSkin->getPadding();
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index 275f57363..0a49d8e31 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -42,8 +42,8 @@ Desktop::Desktop() :
Container(),
gcn::WidgetListener(),
mWallpaper(nullptr),
- mBackgroundColor(Theme::getThemeColor(Theme::BACKGROUND, 128)),
- mBackgroundGrayColor(Theme::getThemeColor(Theme::BACKGROUND_GRAY))
+ mBackgroundColor(getThemeColor(Theme::BACKGROUND, 128)),
+ mBackgroundGrayColor(getThemeColor(Theme::BACKGROUND_GRAY))
{
addWidgetListener(this);
@@ -61,8 +61,7 @@ Desktop::Desktop() :
appName.c_str()));
}
- mVersionLabel->setBackgroundColor(
- Theme::getThemeColor(Theme::BACKGROUND, 128));
+ mVersionLabel->setBackgroundColor(getThemeColor(Theme::BACKGROUND, 128));
add(mVersionLabel, 25, 2);
}
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 31f69c8a3..749b3565e 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -62,8 +62,8 @@ DropDown::DropDown(gcn::ListModel *const listModel,
const std::string &eventId):
gcn::DropDown::DropDown(listModel,
new ScrollArea, new ListBox(listModel)),
- mShadowColor(Theme::getThemeColor(Theme::DROPDOWN_SHADOW)),
- mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT)),
+ mShadowColor(getThemeColor(Theme::DROPDOWN_SHADOW)),
+ mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
mPadding(1),
mImagePadding(2)
{
@@ -115,8 +115,8 @@ DropDown::DropDown(gcn::ListModel *const listModel,
instances++;
- mListBox->setForegroundColor(Theme::getThemeColor(Theme::DROPDOWN));
- setForegroundColor(Theme::getThemeColor(Theme::DROPDOWN));
+ mListBox->setForegroundColor(getThemeColor(Theme::DROPDOWN));
+ setForegroundColor(getThemeColor(Theme::DROPDOWN));
if (!eventId.empty())
setActionEventId(eventId);
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp
index 5adc4e343..8fde755c1 100644
--- a/src/gui/widgets/dropshortcutcontainer.cpp
+++ b/src/gui/widgets/dropshortcutcontainer.cpp
@@ -44,8 +44,8 @@ DropShortcutContainer::DropShortcutContainer():
mItemClicked(false),
mItemMoved(nullptr),
mItemPopup(new ItemPopup),
- mEquipedColor(Theme::getThemeColor(Theme::ITEM_EQUIPPED)),
- mUnEquipedColor(Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED))
+ mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)),
+ mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED))
{
addMouseListener(this);
addWidgetListener(this);
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 9e1206a4c..a2a6b5f22 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -81,7 +81,7 @@ EmoteShortcutContainer::EmoteShortcutContainer():
mBoxHeight = 1;
mBoxWidth = 1;
}
- mForegroundColor = Theme::getThemeColor(Theme::TEXT);
+ mForegroundColor = getThemeColor(Theme::TEXT);
}
EmoteShortcutContainer::~EmoteShortcutContainer()
diff --git a/src/gui/widgets/guildchattab.cpp b/src/gui/widgets/guildchattab.cpp
index 94c54afa4..9fcce8f58 100644
--- a/src/gui/widgets/guildchattab.cpp
+++ b/src/gui/widgets/guildchattab.cpp
@@ -41,10 +41,10 @@
GuildChatTab::GuildChatTab() :
ChatTab(_("Guild"))
{
- setTabColor(&Theme::getThemeColor(Theme::GUILD_CHAT_TAB));
- setHighlightedTabColor(&Theme::getThemeColor(
+ setTabColor(&getThemeColor(Theme::GUILD_CHAT_TAB));
+ setHighlightedTabColor(&getThemeColor(
Theme::GUILD_CHAT_TAB_HIGHLIGHTED));
- setSelectedTabColor(&Theme::getThemeColor(
+ setSelectedTabColor(&getThemeColor(
Theme::GUILD_CHAT_TAB_SELECTED));
}
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index c0e5e888e..9f0dc47e3 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -105,8 +105,8 @@ GuiTable::GuiTable(TableModel *const initial_model, const bool opacity) :
mSelectedColumn(0),
mTopWidget(nullptr)
{
- mBackgroundColor = Theme::getThemeColor(Theme::BACKGROUND);
- mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT);
+ mBackgroundColor = getThemeColor(Theme::BACKGROUND);
+ mHighlightColor = getThemeColor(Theme::HIGHLIGHT);
setModel(initial_model);
setFocusable(true);
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 26b9ae74a..adf1188e4 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -176,8 +176,8 @@ ItemContainer::ItemContainer(Inventory *const inventory,
mItemPopup(new ItemPopup),
mShowMatrix(nullptr),
mClicks(1),
- mEquipedColor(Theme::getThemeColor(Theme::ITEM_EQUIPPED)),
- mUnEquipedColor(Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED))
+ mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)),
+ mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED))
{
setFocusable(true);
addKeyListener(this);
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index c0cd7e410..9a53b5b17 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -52,8 +52,8 @@ ItemShortcutContainer::ItemShortcutContainer(const unsigned number) :
mNumber(number),
mItemPopup(new ItemPopup),
mSpellPopup(new SpellPopup),
- mEquipedColor(Theme::getThemeColor(Theme::ITEM_EQUIPPED)),
- mUnEquipedColor(Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED))
+ mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)),
+ mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED))
{
addMouseListener(this);
addWidgetListener(this);
@@ -76,7 +76,7 @@ ItemShortcutContainer::ItemShortcutContainer(const unsigned number) :
mBoxHeight = 1;
mBoxWidth = 1;
}
- mForegroundColor = Theme::getThemeColor(Theme::TEXT);
+ mForegroundColor = getThemeColor(Theme::TEXT);
}
ItemShortcutContainer::~ItemShortcutContainer()
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 4544510a2..63a3f6b76 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -53,7 +53,7 @@ Label::~Label()
void Label::init()
{
- mForegroundColor = Theme::getThemeColor(Theme::LABEL);
+ mForegroundColor = getThemeColor(Theme::LABEL);
if (mInstances == 0)
{
if (Theme::instance())
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 1a8692309..ddb6cfcb9 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -46,12 +46,12 @@ int ListBox::mInstances = 0;
ListBox::ListBox(gcn::ListModel *const listModel):
gcn::ListBox(listModel),
Widget2(),
- mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT)),
+ mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
mDistributeMousePressed(true),
mOldSelected(-1),
mPadding(0)
{
- mForegroundColor = Theme::getThemeColor(Theme::LISTBOX);
+ mForegroundColor = getThemeColor(Theme::LISTBOX);
if (mInstances == 0)
{
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 05dd80233..485529c2c 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -217,7 +217,7 @@ void ProgressBar::render(Graphics *graphics)
TextRenderer::renderText(graphics, mText, textX, textY,
gcn::Graphics::CENTER,
- Theme::getThemeColor(Theme::PROGRESS_BAR),
+ getThemeColor(Theme::PROGRESS_BAR),
gui->getFont(), true, false);
}
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp
index ebe179b53..d7b1769ba 100644
--- a/src/gui/widgets/radiobutton.cpp
+++ b/src/gui/widgets/radiobutton.cpp
@@ -49,7 +49,7 @@ RadioButton::RadioButton(const std::string &caption, const std::string &group,
mImageSize(9),
mSpacing(2)
{
- mForegroundColor = Theme::getThemeColor(Theme::RADIOBUTTON);
+ mForegroundColor = getThemeColor(Theme::RADIOBUTTON);
if (instances == 0)
{
if (Theme::instance())
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 79fca30d5..06627f1a4 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -51,11 +51,11 @@ ShopListBox::ShopListBox(gcn::ListModel *const listModel) :
mItemPopup(new ItemPopup),
mRowHeight(getFont()->getHeight()),
mPriceCheck(true),
- mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT)),
- mBackgroundColor(Theme::getThemeColor(Theme::BACKGROUND)),
- mWarningColor(Theme::getThemeColor(Theme::SHOP_WARNING))
+ mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
+ mBackgroundColor(getThemeColor(Theme::BACKGROUND)),
+ mWarningColor(getThemeColor(Theme::SHOP_WARNING))
{
- mForegroundColor = Theme::getThemeColor(Theme::LISTBOX);
+ mForegroundColor = getThemeColor(Theme::LISTBOX);
}
ShopListBox::ShopListBox(gcn::ListModel *const listModel,
@@ -66,11 +66,11 @@ ShopListBox::ShopListBox(gcn::ListModel *const listModel,
mItemPopup(new ItemPopup),
mRowHeight(std::max(getFont()->getHeight(), ITEM_ICON_SIZE)),
mPriceCheck(true),
- mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT)),
- mBackgroundColor(Theme::getThemeColor(Theme::BACKGROUND)),
- mWarningColor(Theme::getThemeColor(Theme::SHOP_WARNING))
+ mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
+ mBackgroundColor(getThemeColor(Theme::BACKGROUND)),
+ mWarningColor(getThemeColor(Theme::SHOP_WARNING))
{
- mForegroundColor = Theme::getThemeColor(Theme::LISTBOX);
+ mForegroundColor = getThemeColor(Theme::LISTBOX);
}
void ShopListBox::init()
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index ae215b480..22ed8d6b5 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -72,7 +72,7 @@ SpellShortcutContainer::SpellShortcutContainer(const unsigned number) :
mBoxHeight = 1;
mBoxWidth = 1;
}
- mForegroundColor = Theme::getThemeColor(Theme::TEXT);
+ mForegroundColor = getThemeColor(Theme::TEXT);
}
SpellShortcutContainer::~SpellShortcutContainer()
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index 0834b8550..74e68c74e 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -68,11 +68,11 @@ Tab::Tab() :
mLabel(new Label),
mHasMouse(false),
mTabbedArea(nullptr),
- mTabColor(&Theme::getThemeColor(Theme::TAB)),
- mTabHighlightedColor(&Theme::getThemeColor(Theme::TAB_HIGHLIGHTED)),
- mTabSelectedColor(&Theme::getThemeColor(Theme::TAB_SELECTED)),
- mFlashColor(&Theme::getThemeColor(Theme::TAB_FLASH)),
- mPlayerFlashColor(&Theme::getThemeColor(Theme::TAB_PLAYER_FLASH)),
+ mTabColor(&getThemeColor(Theme::TAB)),
+ mTabHighlightedColor(&getThemeColor(Theme::TAB_HIGHLIGHTED)),
+ mTabSelectedColor(&getThemeColor(Theme::TAB_SELECTED)),
+ mFlashColor(&getThemeColor(Theme::TAB_FLASH)),
+ mPlayerFlashColor(&getThemeColor(Theme::TAB_PLAYER_FLASH)),
mVertexes(new GraphicsVertexes()),
mRedraw(true),
mMode(0)
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index d66bbced6..017c0f2a2 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -38,7 +38,7 @@ TextBox::TextBox() :
Widget2(),
mMinWidth(getWidth())
{
- mForegroundColor = Theme::getThemeColor(Theme::TEXTBOX);
+ mForegroundColor = getThemeColor(Theme::TEXTBOX);
setOpaque(false);
setFrameSize(0);
}
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 690bddcd9..6c11d2e17 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -58,10 +58,10 @@ TextField::TextField(const std::string &text, const bool loseFocusOnTab,
mMaximum(0),
mLoseFocusOnTab(loseFocusOnTab),
mLastEventPaste(false),
- mCaretColor(&Theme::getThemeColor(Theme::CARET))
+ mCaretColor(&getThemeColor(Theme::CARET))
{
setFrameSize(2);
- mForegroundColor = Theme::getThemeColor(Theme::TEXTFIELD);
+ mForegroundColor = getThemeColor(Theme::TEXTFIELD);
if (instances == 0)
{
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp
index 17630cbec..92ab9e4b9 100644
--- a/src/gui/widgets/textpreview.cpp
+++ b/src/gui/widgets/textpreview.cpp
@@ -38,8 +38,8 @@ TextPreview::TextPreview(const std::string &text) :
Widget2(),
mFont(gui->getFont()),
mText(text),
- mTextColor(&Theme::getThemeColor(Theme::TEXT)),
- mBGColor(&Theme::getThemeColor(Theme::BACKGROUND)),
+ mTextColor(&getThemeColor(Theme::TEXT)),
+ mBGColor(&getThemeColor(Theme::BACKGROUND)),
mTextBGColor(nullptr),
mTextAlpha(false),
mOpaque(false),
diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp
index 2126f3c7b..4960d356a 100644
--- a/src/gui/widgets/whispertab.cpp
+++ b/src/gui/widgets/whispertab.cpp
@@ -171,17 +171,17 @@ void WhisperTab::getAutoCompleteList(StringVect &names) const
void WhisperTab::setWhisperTabColors()
{
- setTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB));
- setHighlightedTabColor(&Theme::getThemeColor(
+ setTabColor(&getThemeColor(Theme::WHISPER_TAB));
+ setHighlightedTabColor(&getThemeColor(
Theme::WHISPER_TAB_HIGHLIGHTED));
- setSelectedTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB_SELECTED));
+ setSelectedTabColor(&getThemeColor(Theme::WHISPER_TAB_SELECTED));
}
void WhisperTab::setWhisperTabOfflineColors()
{
- setTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB_OFFLINE));
- setHighlightedTabColor(&Theme::getThemeColor(
+ setTabColor(&getThemeColor(Theme::WHISPER_TAB_OFFLINE));
+ setHighlightedTabColor(&getThemeColor(
Theme::WHISPER_TAB_OFFLINE_HIGHLIGHTED));
- setSelectedTabColor(&Theme::getThemeColor(
+ setSelectedTabColor(&getThemeColor(
Theme::WHISPER_TAB_OFFLINE_SELECTED));
}
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h
index 0bf7ae87a..314b95105 100644
--- a/src/gui/widgets/widget2.h
+++ b/src/gui/widgets/widget2.h
@@ -26,7 +26,8 @@
class Widget2
{
public:
- Widget2()
+ Widget2() :
+ mPalette(1)
{
}
@@ -35,13 +36,13 @@ class Widget2
}
inline const gcn::Color &getThemeColor(const int type,
- const int alpha = 255)
+ const int alpha = 255) const
{
return Theme::getThemeColor(type * mPalette, alpha);
}
inline const gcn::Color &getThemeCharColor(const signed char c,
- bool &valid)
+ bool &valid) const
{
const int colorId = Theme::getIdByChar(c, valid);
if (valid)
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index dbf1e747d..fa673e420 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -139,7 +139,7 @@ Window::Window(const std::string &caption, const bool modal,
setVisible(false);
addWidgetListener(this);
- mForegroundColor = Theme::getThemeColor(Theme::WINDOW);
+ mForegroundColor = getThemeColor(Theme::WINDOW);
}
Window::~Window()