diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-03-30 17:04:39 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-03-30 17:04:39 -0600 |
commit | 61392840d52a3976b886f7638ff5babcb5509c49 (patch) | |
tree | 0dd7d5c5a519347dfaac9fd28c6a9416a31afe57 /src/gui/widgets/tab.cpp | |
parent | 9dcf6f579a70736fc2027ea8c0c6d63baa8bbe5a (diff) | |
download | mana-61392840d52a3976b886f7638ff5babcb5509c49.tar.gz mana-61392840d52a3976b886f7638ff5babcb5509c49.tar.bz2 mana-61392840d52a3976b886f7638ff5babcb5509c49.tar.xz mana-61392840d52a3976b886f7638ff5babcb5509c49.zip |
Allow tabs to be colored and color whisper tabs
Diffstat (limited to 'src/gui/widgets/tab.cpp')
-rw-r--r-- | src/gui/widgets/tab.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index f7161ed9..3c95eb26 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -62,7 +62,8 @@ static TabData const data[TAB_COUNT] = { ImageRect Tab::tabImg[TAB_COUNT]; -Tab::Tab() : gcn::Tab() +Tab::Tab() : gcn::Tab(), + mTabColor(guiPalette->getColor(Palette::TEXT)) { init(); } @@ -126,7 +127,7 @@ void Tab::draw(gcn::Graphics *graphics) { mode = TAB_SELECTED; // if tab is selected, it doesnt need to highlight activity - mLabel->setForegroundColor(guiPalette->getColor(Palette::TEXT)); + mLabel->setForegroundColor(mTabColor); mHighlighted = false; } else if (mHighlighted) @@ -136,7 +137,7 @@ void Tab::draw(gcn::Graphics *graphics) } else { - mLabel->setForegroundColor(guiPalette->getColor(Palette::TEXT)); + mLabel->setForegroundColor(mTabColor); } } @@ -158,6 +159,13 @@ void Tab::draw(gcn::Graphics *graphics) drawChildren(graphics); } +void Tab::setTabColor(gcn::Color color) +{ + if (color == NULL) + color = guiPalette->getColor(Palette::TEXT); + mTabColor = color; +} + void Tab::setHighlighted(bool high) { mHighlighted = high; |