diff options
author | David Athay <ko2fan@gmail.com> | 2009-01-28 11:47:05 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-01-28 11:47:05 +0000 |
commit | 1a769276ce68285040bffd63bd1c01495ce411a7 (patch) | |
tree | b0b7007ead5276801df1f95455abb31f1c130617 /src/gui/widgets/tab.cpp | |
parent | 3ca85b152531b9dd9cffa18d9b64d7c7ae615adf (diff) | |
download | mana-client-1a769276ce68285040bffd63bd1c01495ce411a7.tar.gz mana-client-1a769276ce68285040bffd63bd1c01495ce411a7.tar.bz2 mana-client-1a769276ce68285040bffd63bd1c01495ce411a7.tar.xz mana-client-1a769276ce68285040bffd63bd1c01495ce411a7.zip |
Added channel highlighting upon activity. Added /kick command to get rid of users from a channel
Diffstat (limited to 'src/gui/widgets/tab.cpp')
-rw-r--r-- | src/gui/widgets/tab.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index c53ac85c..b09bc5b3 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -21,8 +21,9 @@ #include <algorithm> -#include "tab.h" +#include <guichan/widgets/label.hpp> +#include "tab.h" #include "tabbedarea.h" #include "../../graphics.h" @@ -79,6 +80,7 @@ Tab::~Tab() void Tab::init() { setFrameSize(0); + mHighlighted = false; if (mInstances == 0) { @@ -109,18 +111,26 @@ void Tab::init() void Tab::draw(gcn::Graphics *graphics) { - int mode; + int mode = TAB_STANDARD; // check which type of tab to draw - if (mTabbedArea && mTabbedArea->isTabSelected(this)) - { - mode = TAB_SELECTED; - } - else + if (mTabbedArea) { - mode = TAB_STANDARD; + if(mTabbedArea->isTabSelected(this)) + { + mode = TAB_SELECTED; + // if tab is selected, it doesnt need to highlight activity + mLabel->setForegroundColor(gcn::Color(0, 0, 0)); + mHighlighted = false; + } + else if (mHighlighted) + { + mode = TAB_HIGHLIGHTED; + mLabel->setForegroundColor(gcn::Color(255, 0, 0)); + } } + // draw tab static_cast<Graphics*>(graphics)-> drawImageRect(0, 0, getWidth(), getHeight(), tabImg[mode]); @@ -128,3 +138,8 @@ void Tab::draw(gcn::Graphics *graphics) // draw label drawChildren(graphics); } + +void Tab::setHighlighted(bool high) +{ + mHighlighted = high; +} |