summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-27 23:13:19 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-28 00:45:34 +0300
commitd05f3904b05e8af1cd319d75a380b2cce7edf77d (patch)
treecd29c1f738ac6415cbee8940034a4143f4c72886 /src/gui/widgets
parentdba24b2e59eb739e73228dbcf707e943905a9e5a (diff)
downloadmv-d05f3904b05e8af1cd319d75a380b2cce7edf77d.tar.gz
mv-d05f3904b05e8af1cd319d75a380b2cce7edf77d.tar.bz2
mv-d05f3904b05e8af1cd319d75a380b2cce7edf77d.tar.xz
mv-d05f3904b05e8af1cd319d75a380b2cce7edf77d.zip
Add outlining support to tabs.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/guildchattab.cpp11
-rw-r--r--src/gui/widgets/tab.cpp20
-rw-r--r--src/gui/widgets/tab.h45
-rw-r--r--src/gui/widgets/whispertab.cpp20
4 files changed, 68 insertions, 28 deletions
diff --git a/src/gui/widgets/guildchattab.cpp b/src/gui/widgets/guildchattab.cpp
index 5d60c2a29..2b88b4590 100644
--- a/src/gui/widgets/guildchattab.cpp
+++ b/src/gui/widgets/guildchattab.cpp
@@ -38,11 +38,12 @@
GuildChatTab::GuildChatTab(const Widget2 *const widget) :
ChatTab(widget, _("Guild"))
{
- setTabColor(&getThemeColor(Theme::GUILD_CHAT_TAB));
- setHighlightedTabColor(&getThemeColor(
- Theme::GUILD_CHAT_TAB_HIGHLIGHTED));
- setSelectedTabColor(&getThemeColor(
- Theme::GUILD_CHAT_TAB_SELECTED));
+ setTabColor(&getThemeColor(Theme::GUILD_CHAT_TAB),
+ &getThemeColor(Theme::GUILD_CHAT_TAB_OUTLINE));
+ setHighlightedTabColor(&getThemeColor(Theme::GUILD_CHAT_TAB_HIGHLIGHTED),
+ &getThemeColor(Theme::GUILD_CHAT_TAB_HIGHLIGHTED_OUTLINE));
+ setSelectedTabColor(&getThemeColor(Theme::GUILD_CHAT_TAB_SELECTED),
+ &getThemeColor(Theme::GUILD_CHAT_TAB_SELECTED_OUTLINE));
}
GuildChatTab::~GuildChatTab()
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index a0ebc7732..b5e301b24 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -64,10 +64,16 @@ Tab::Tab(const Widget2 *const widget) :
mHasMouse(false),
mTabbedArea(nullptr),
mTabColor(&getThemeColor(Theme::TAB)),
+ mTabOutlineColor(&getThemeColor(Theme::TAB_OUTLINE)),
mTabHighlightedColor(&getThemeColor(Theme::TAB_HIGHLIGHTED)),
+ mTabHighlightedOutlineColor(&getThemeColor(
+ Theme::TAB_HIGHLIGHTED_OUTLINE)),
mTabSelectedColor(&getThemeColor(Theme::TAB_SELECTED)),
+ mTabSelectedOutlineColor(&getThemeColor(Theme::TAB_SELECTED_OUTLINE)),
mFlashColor(&getThemeColor(Theme::TAB_FLASH)),
+ mFlashOutlineColor(&getThemeColor(Theme::TAB_FLASH_OUTLINE)),
mPlayerFlashColor(&getThemeColor(Theme::TAB_PLAYER_FLASH)),
+ mPlayerFlashOutlineColor(&getThemeColor(Theme::TAB_PLAYER_FLASH_OUTLINE)),
mVertexes(new ImageCollection),
mRedraw(true),
mMode(0)
@@ -155,28 +161,32 @@ void Tab::draw(gcn::Graphics *graphics)
{
if (mTabbedArea->isTabSelected(this))
{
- mLabel->setForegroundColor(*mTabSelectedColor);
+ mLabel->setForegroundColorAll(*mTabSelectedColor,
+ *mTabSelectedOutlineColor);
mode = TAB_SELECTED;
// if tab is selected, it doesnt need to highlight activity
mFlash = 0;
}
else if (mHasMouse)
{
- mLabel->setForegroundColor(*mTabHighlightedColor);
+ mLabel->setForegroundColorAll(*mTabHighlightedColor,
+ *mTabHighlightedOutlineColor);
mode = TAB_HIGHLIGHTED;
}
else
{
- mLabel->setForegroundColor(*mTabColor);
+ mLabel->setForegroundColorAll(*mTabColor, *mTabOutlineColor);
}
switch (mFlash)
{
case 1:
- mLabel->setForegroundColor(*mFlashColor);
+ mLabel->setForegroundColorAll(*mFlashColor,
+ *mFlashOutlineColor);
break;
case 2:
- mLabel->setForegroundColor(*mPlayerFlashColor);
+ mLabel->setForegroundColorAll(*mPlayerFlashColor,
+ *mPlayerFlashOutlineColor);
break;
default:
break;
diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h
index 17237edd7..1e30fdeb2 100644
--- a/src/gui/widgets/tab.h
+++ b/src/gui/widgets/tab.h
@@ -66,32 +66,52 @@ class Tab : public gcn::BasicContainer,
/**
* Set the normal color for the tab's text.
*/
- void setTabColor(const gcn::Color *const color)
- { mTabColor = color; }
+ void setTabColor(const gcn::Color *const color1,
+ const gcn::Color *const color2)
+ {
+ mTabColor = color1;
+ mTabOutlineColor = color2;
+ }
/**
* Set the highlighted color for the tab's text.
*/
- void setHighlightedTabColor(const gcn::Color *const color)
- { mTabHighlightedColor = color; }
+ void setHighlightedTabColor(const gcn::Color *const color1,
+ const gcn::Color *const color2)
+ {
+ mTabHighlightedColor = color1;
+ mTabHighlightedOutlineColor = color2;
+ }
/**
* Set the selected color for the tab's text.
*/
- void setSelectedTabColor(const gcn::Color *const color)
- { mTabSelectedColor = color; }
+ void setSelectedTabColor(const gcn::Color *const color1,
+ const gcn::Color *const color2)
+ {
+ mTabSelectedColor = color1;
+ mTabSelectedOutlineColor = color2;
+ }
/**
* Set the flash color for the tab's text.
*/
- void setFlashTabColor(const gcn::Color *const color)
- { mFlashColor = color; }
+ void setFlashTabColor(const gcn::Color *const color1,
+ const gcn::Color *const color2)
+ {
+ mFlashColor = color1;
+ mFlashOutlineColor = color2;
+ }
/**
* Set the player flash color for the tab's text.
*/
- void setPlayerFlashTabColor(const gcn::Color *const color)
- { mPlayerFlashColor = color; }
+ void setPlayerFlashTabColor(const gcn::Color *const color1,
+ const gcn::Color *const color2)
+ {
+ mPlayerFlashColor = color1;
+ mPlayerFlashOutlineColor = color2;
+ }
/**
* Set tab flashing state
@@ -146,10 +166,15 @@ class Tab : public gcn::BasicContainer,
static float mAlpha;
const gcn::Color *mTabColor;
+ const gcn::Color *mTabOutlineColor;
const gcn::Color *mTabHighlightedColor;
+ const gcn::Color *mTabHighlightedOutlineColor;
const gcn::Color *mTabSelectedColor;
+ const gcn::Color *mTabSelectedOutlineColor;
const gcn::Color *mFlashColor;
+ const gcn::Color *mFlashOutlineColor;
const gcn::Color *mPlayerFlashColor;
+ const gcn::Color *mPlayerFlashOutlineColor;
int mFlash;
ImageCollection *mVertexes;
bool mRedraw;
diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp
index c22c9d694..439f1c2ca 100644
--- a/src/gui/widgets/whispertab.cpp
+++ b/src/gui/widgets/whispertab.cpp
@@ -167,17 +167,21 @@ void WhisperTab::getAutoCompleteList(StringVect &names) const
void WhisperTab::setWhisperTabColors()
{
- setTabColor(&getThemeColor(Theme::WHISPER_TAB));
- setHighlightedTabColor(&getThemeColor(
- Theme::WHISPER_TAB_HIGHLIGHTED));
- setSelectedTabColor(&getThemeColor(Theme::WHISPER_TAB_SELECTED));
+ setTabColor(&getThemeColor(Theme::WHISPER_TAB),
+ &getThemeColor(Theme::WHISPER_TAB_OUTLINE));
+ setHighlightedTabColor(&getThemeColor(Theme::WHISPER_TAB_HIGHLIGHTED),
+ &getThemeColor(Theme::WHISPER_TAB_HIGHLIGHTED_OUTLINE));
+ setSelectedTabColor(&getThemeColor(Theme::WHISPER_TAB_SELECTED),
+ &getThemeColor(Theme::WHISPER_TAB_SELECTED_OUTLINE));
}
void WhisperTab::setWhisperTabOfflineColors()
{
- setTabColor(&getThemeColor(Theme::WHISPER_TAB_OFFLINE));
+ setTabColor(&getThemeColor(Theme::WHISPER_TAB_OFFLINE),
+ &getThemeColor(Theme::WHISPER_TAB_OFFLINE_OUTLINE));
setHighlightedTabColor(&getThemeColor(
- Theme::WHISPER_TAB_OFFLINE_HIGHLIGHTED));
- setSelectedTabColor(&getThemeColor(
- Theme::WHISPER_TAB_OFFLINE_SELECTED));
+ Theme::WHISPER_TAB_OFFLINE_HIGHLIGHTED), &getThemeColor(
+ Theme::WHISPER_TAB_OFFLINE_HIGHLIGHTED_OUTLINE));
+ setSelectedTabColor(&getThemeColor(Theme::WHISPER_TAB_OFFLINE_SELECTED),
+ &getThemeColor(Theme::WHISPER_TAB_OFFLINE_SELECTED_OUTLINE));
}