summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/theme.cpp2
-rw-r--r--src/gui/theme.h2
-rw-r--r--src/gui/widgets/tab.cpp9
-rw-r--r--src/gui/widgets/tab.h2
4 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 2d21f1a2b..fd6ccc23d 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -685,6 +685,8 @@ static int readColorType(const std::string &type)
"LISTBOX",
"RADIOBUTTON",
"TAB",
+ "TAB_HIGHLIGHTED",
+ "TAB_SELECTED",
"TEXTBOX",
"TEXTFIELD",
"WINDOW",
diff --git a/src/gui/theme.h b/src/gui/theme.h
index de027523d..f73988c48 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -177,6 +177,8 @@ class Theme : public Palette, public ConfigListener
LISTBOX,
RADIOBUTTON,
TAB,
+ TAB_HIGHLIGHTED,
+ TAB_SELECTED,
TEXTBOX,
TEXTFIELD,
WINDOW,
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index eb470cc02..479735e7c 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -64,6 +64,8 @@ ImageRect Tab::tabImg[TAB_COUNT];
Tab::Tab() :
gcn::Tab(),
mTabColor(&Theme::getThemeColor(Theme::TAB)),
+ mTabHighlightedColor(&Theme::getThemeColor(Theme::TAB_HIGHLIGHTED)),
+ mTabSelectedColor(&Theme::getThemeColor(Theme::TAB_SELECTED)),
mVertexes(new GraphicsVertexes()),
mRedraw(true),
mMode(0),
@@ -138,17 +140,22 @@ void Tab::draw(gcn::Graphics *graphics)
// check which type of tab to draw
if (mTabbedArea)
{
- mLabel->setForegroundColor(*mTabColor);
if (mTabbedArea->isTabSelected(this))
{
+ mLabel->setForegroundColor(*mTabSelectedColor);
mode = TAB_SELECTED;
// if tab is selected, it doesnt need to highlight activity
mFlash = 0;
}
else if (mHasMouse)
{
+ mLabel->setForegroundColor(*mTabHighlightedColor);
mode = TAB_HIGHLIGHTED;
}
+ else
+ {
+ mLabel->setForegroundColor(*mTabColor);
+ }
switch (mFlash)
{
diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h
index 0907379d0..d0fa41eb6 100644
--- a/src/gui/widgets/tab.h
+++ b/src/gui/widgets/tab.h
@@ -87,6 +87,8 @@ class Tab : public gcn::Tab, public gcn::WidgetListener
static float mAlpha;
const gcn::Color *mTabColor;
+ const gcn::Color *mTabHighlightedColor;
+ const gcn::Color *mTabSelectedColor;
int mFlash;
GraphicsVertexes *mVertexes;
bool mRedraw;