summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-08 02:57:44 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-08 02:57:44 +0300
commite91282a6213a9809a06cb0cb3deff93e0246fe5b (patch)
tree62d4214d479883aae84a80ea0bb16d6cccfb4bc8 /src/gui/widgets
parent577b75a14fa04b0d78281257ee7f5e3c42be3b7e (diff)
downloadManaVerse-e91282a6213a9809a06cb0cb3deff93e0246fe5b.tar.gz
ManaVerse-e91282a6213a9809a06cb0cb3deff93e0246fe5b.tar.bz2
ManaVerse-e91282a6213a9809a06cb0cb3deff93e0246fe5b.tar.xz
ManaVerse-e91282a6213a9809a06cb0cb3deff93e0246fe5b.zip
Allow set tab colors from outside of tab.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/tab.cpp20
-rw-r--r--src/gui/widgets/tab.h36
2 files changed, 36 insertions, 20 deletions
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index 0999dc7a9..124579fab 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -67,11 +67,11 @@ Tab::Tab() :
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)),
mVertexes(new GraphicsVertexes()),
mRedraw(true),
- mMode(0),
- mFlashColor(Theme::getThemeColor(Theme::TAB_FLASH)),
- mPlayerFlashColor(Theme::getThemeColor(Theme::TAB_PLAYER_FLASH))
+ mMode(0)
{
init();
}
@@ -161,10 +161,10 @@ void Tab::draw(gcn::Graphics *graphics)
switch (mFlash)
{
case 1:
- mLabel->setForegroundColor(mFlashColor);
+ mLabel->setForegroundColor(*mFlashColor);
break;
case 2:
- mLabel->setForegroundColor(mPlayerFlashColor);
+ mLabel->setForegroundColor(*mPlayerFlashColor);
break;
default:
break;
@@ -192,16 +192,6 @@ void Tab::draw(gcn::Graphics *graphics)
drawChildren(graphics);
}
-void Tab::setTabColor(const gcn::Color *const color)
-{
- mTabColor = color;
-}
-
-void Tab::setFlash(const int flash)
-{
- mFlash = flash;
-}
-
void Tab::widgetResized(const gcn::Event &event A_UNUSED)
{
mRedraw = true;
diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h
index d0fa41eb6..a8ff5eb3d 100644
--- a/src/gui/widgets/tab.h
+++ b/src/gui/widgets/tab.h
@@ -52,14 +52,40 @@ class Tab : public gcn::Tab, public gcn::WidgetListener
void draw(gcn::Graphics *graphics);
/**
- * Set the normal color fo the tab's text.
+ * Set the normal color for the tab's text.
*/
- void setTabColor(const gcn::Color *const color);
+ void setTabColor(const gcn::Color *const color)
+ { mTabColor = color; }
+
+ /**
+ * Set the highlighted color for the tab's text.
+ */
+ void setHighlightedTabColor(const gcn::Color *const color)
+ { mTabHighlightedColor = color; }
+
+ /**
+ * Set the selected color for the tab's text.
+ */
+ void setSelectedTabColor(const gcn::Color *const color)
+ { mTabSelectedColor = color; }
+
+ /**
+ * Set the flash color for the tab's text.
+ */
+ void setFlashTabColor(const gcn::Color *const color)
+ { mFlashColor = color; }
+
+ /**
+ * Set the player flash color for the tab's text.
+ */
+ void setPlayerFlashTabColor(const gcn::Color *const color)
+ { mPlayerFlashColor = color; }
/**
* Set tab flashing state
*/
- void setFlash(const int flash);
+ void setFlash(const int flash)
+ { mFlash = flash; }
int getFlash() const
{ return mFlash; }
@@ -89,12 +115,12 @@ class Tab : public gcn::Tab, public gcn::WidgetListener
const gcn::Color *mTabColor;
const gcn::Color *mTabHighlightedColor;
const gcn::Color *mTabSelectedColor;
+ const gcn::Color *mFlashColor;
+ const gcn::Color *mPlayerFlashColor;
int mFlash;
GraphicsVertexes *mVertexes;
bool mRedraw;
int mMode;
- gcn::Color mFlashColor;
- gcn::Color mPlayerFlashColor;
};
#endif