summaryrefslogtreecommitdiff
path: root/src/gui
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
parentdba24b2e59eb739e73228dbcf707e943905a9e5a (diff)
downloadmanaplus-d05f3904b05e8af1cd319d75a380b2cce7edf77d.tar.gz
manaplus-d05f3904b05e8af1cd319d75a380b2cce7edf77d.tar.bz2
manaplus-d05f3904b05e8af1cd319d75a380b2cce7edf77d.tar.xz
manaplus-d05f3904b05e8af1cd319d75a380b2cce7edf77d.zip
Add outlining support to tabs.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/socialwindow.cpp30
-rw-r--r--src/gui/theme.cpp19
-rw-r--r--src/gui/theme.h19
-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
7 files changed, 124 insertions, 40 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 90899ea6f..aa66063b6 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -143,11 +143,13 @@ public:
{
setCaption(_("Guild"));
- setTabColor(&getThemeColor(Theme::GUILD_SOCIAL_TAB));
+ setTabColor(&getThemeColor(Theme::GUILD_SOCIAL_TAB),
+ &getThemeColor(Theme::GUILD_SOCIAL_TAB_OUTLINE));
setHighlightedTabColor(&getThemeColor(
- Theme::GUILD_SOCIAL_TAB_HIGHLIGHTED));
- setSelectedTabColor(&getThemeColor(
- Theme::GUILD_SOCIAL_TAB_SELECTED));
+ Theme::GUILD_SOCIAL_TAB_HIGHLIGHTED), &getThemeColor(
+ Theme::GUILD_SOCIAL_TAB_HIGHLIGHTED_OUTLINE));
+ setSelectedTabColor(&getThemeColor(Theme::GUILD_SOCIAL_TAB_SELECTED),
+ &getThemeColor(Theme::GUILD_SOCIAL_TAB_SELECTED_OUTLINE));
mList = new AvatarListBox(this, guild);
mScroll = new ScrollArea(mList, showBackground,
@@ -250,11 +252,13 @@ public:
{
setCaption(_("Guild"));
- setTabColor(&getThemeColor(Theme::GUILD_SOCIAL_TAB));
+ setTabColor(&getThemeColor(Theme::GUILD_SOCIAL_TAB),
+ &getThemeColor(Theme::GUILD_SOCIAL_TAB_OUTLINE));
setHighlightedTabColor(&getThemeColor(
- Theme::GUILD_SOCIAL_TAB_HIGHLIGHTED));
- setSelectedTabColor(&getThemeColor(
- Theme::GUILD_SOCIAL_TAB_SELECTED));
+ Theme::GUILD_SOCIAL_TAB_HIGHLIGHTED), &getThemeColor(
+ Theme::GUILD_SOCIAL_TAB_HIGHLIGHTED_OUTLINE));
+ setSelectedTabColor(&getThemeColor(Theme::GUILD_SOCIAL_TAB_SELECTED),
+ &getThemeColor(Theme::GUILD_SOCIAL_TAB_SELECTED_OUTLINE));
mList = new AvatarListBox(this, guild);
mScroll = new ScrollArea(mList, showBackground,
@@ -313,11 +317,13 @@ public:
{
setCaption(_("Party"));
- setTabColor(&getThemeColor(Theme::PARTY_SOCIAL_TAB));
+ setTabColor(&getThemeColor(Theme::PARTY_SOCIAL_TAB),
+ &getThemeColor(Theme::PARTY_SOCIAL_TAB_OUTLINE));
setHighlightedTabColor(&getThemeColor(
- Theme::PARTY_SOCIAL_TAB_HIGHLIGHTED));
- setSelectedTabColor(&getThemeColor(
- Theme::PARTY_SOCIAL_TAB_SELECTED));
+ Theme::PARTY_SOCIAL_TAB_HIGHLIGHTED), &getThemeColor(
+ Theme::PARTY_SOCIAL_TAB_HIGHLIGHTED_OUTLINE));
+ setSelectedTabColor(&getThemeColor(Theme::PARTY_SOCIAL_TAB_SELECTED),
+ &getThemeColor(Theme::PARTY_SOCIAL_TAB_SELECTED_OUTLINE));
mList = new AvatarListBox(this, party);
mScroll = new ScrollArea(mList, showBackground,
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 35fd7ea70..91c8ed3a8 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -745,8 +745,11 @@ static int readColorType(const std::string &type)
"POPUP",
"POPUP_OUTLINE",
"TAB",
+ "TAB_OUTLINE",
"TAB_HIGHLIGHTED",
+ "TAB_HIGHLIGHTED_OUTLINE",
"TAB_SELECTED",
+ "TAB_SELECTED_OUTLINE",
"TEXTBOX",
"TEXTFIELD",
"WINDOW",
@@ -754,17 +757,27 @@ static int readColorType(const std::string &type)
"PARTY_CHAT_TAB",
"PARTY_CHAT_TAB_OUTLINE",
"PARTY_SOCIAL_TAB",
+ "PARTY_SOCIAL_TAB_OUTLINE",
"GUILD_CHAT_TAB",
"GUILD_CHAT_TAB_OUTLINE",
"GUILD_SOCIAL_TAB",
+ "GUILD_SOCIAL_TAB_OUTLINE",
"PARTY_CHAT_TAB_HIGHLIGHTED",
+ "PARTY_CHAT_TAB_HIGHLIGHTED_OUTLINE",
"PARTY_SOCIAL_TAB_HIGHLIGHTED",
+ "PARTY_SOCIAL_TAB_HIGHLIGHTED_OUTLINE",
"GUILD_CHAT_TAB_HIGHLIGHTED",
+ "GUILD_CHAT_TAB_HIGHLIGHTED_OUTLINE",
"GUILD_SOCIAL_TAB_HIGHLIGHTED",
+ "GUILD_SOCIAL_TAB_HIGHLIGHTED_OUTLINE",
"PARTY_CHAT_TAB_SELECTED",
+ "PARTY_CHAT_TAB_SELECTED_OUTLINE",
"PARTY_SOCIAL_TAB_SELECTED",
+ "PARTY_SOCIAL_TAB_SELECTED_OUTLINE",
"GUILD_CHAT_TAB_SELECTED",
+ "GUILD_CHAT_TAB_SELECTED_OUTLINE",
"GUILD_SOCIAL_TAB_SELECTED",
+ "GUILD_SOCIAL_TAB_SELECTED_OUTLINE",
"BACKGROUND",
"BACKGROUND_GRAY",
"SCROLLBAR_GRAY",
@@ -772,7 +785,9 @@ static int readColorType(const std::string &type)
"HIGHLIGHT",
"HIGHLIGHT_OUTLINE",
"TAB_FLASH",
+ "TAB_FLASH_OUTLINE",
"TAB_PLAYER_FLASH",
+ "TAB_PLAYER_FLASH_OUTLINE",
"SHOP_WARNING",
"ITEM_EQUIPPED",
"ITEM_NOT_EQUIPPED",
@@ -787,9 +802,13 @@ static int readColorType(const std::string &type)
"WHISPER_TAB_OFFLINE",
"WHISPER_TAB_OFFLINE_OUTLINE",
"WHISPER_TAB_HIGHLIGHTED",
+ "WHISPER_TAB_HIGHLIGHTED_OUTLINE",
"WHISPER_TAB_OFFLINE_HIGHLIGHTED",
+ "WHISPER_TAB_OFFLINE_HIGHLIGHTED_OUTLINE",
"WHISPER_TAB_SELECTED",
+ "WHISPER_TAB_SELECTED_OUTLINE",
"WHISPER_TAB_OFFLINE_SELECTED",
+ "WHISPER_TAB_OFFLINE_SELECTED_OUTLINE",
"IS",
"IS_OUTLINE",
"SERVER",
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 897cdf7db..7782bac71 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -209,8 +209,11 @@ class Theme final : public Palette, public ConfigListener
POPUP,
POPUP_OUTLINE,
TAB,
+ TAB_OUTLINE,
TAB_HIGHLIGHTED,
+ TAB_HIGHLIGHTED_OUTLINE,
TAB_SELECTED,
+ TAB_SELECTED_OUTLINE,
TEXTBOX,
TEXTFIELD,
WINDOW,
@@ -218,17 +221,27 @@ class Theme final : public Palette, public ConfigListener
PARTY_CHAT_TAB,
PARTY_CHAT_TAB_OUTLINE,
PARTY_SOCIAL_TAB,
+ PARTY_SOCIAL_TAB_OUTLINE,
GUILD_CHAT_TAB,
GUILD_CHAT_TAB_OUTLINE,
GUILD_SOCIAL_TAB,
+ GUILD_SOCIAL_TAB_OUTLINE,
PARTY_CHAT_TAB_HIGHLIGHTED,
+ PARTY_CHAT_TAB_HIGHLIGHTED_OUTLINE,
PARTY_SOCIAL_TAB_HIGHLIGHTED,
+ PARTY_SOCIAL_TAB_HIGHLIGHTED_OUTLINE,
GUILD_CHAT_TAB_HIGHLIGHTED,
+ GUILD_CHAT_TAB_HIGHLIGHTED_OUTLINE,
GUILD_SOCIAL_TAB_HIGHLIGHTED,
+ GUILD_SOCIAL_TAB_HIGHLIGHTED_OUTLINE,
PARTY_CHAT_TAB_SELECTED,
+ PARTY_CHAT_TAB_SELECTED_OUTLINE,
PARTY_SOCIAL_TAB_SELECTED,
+ PARTY_SOCIAL_TAB_SELECTED_OUTLINE,
GUILD_CHAT_TAB_SELECTED,
+ GUILD_CHAT_TAB_SELECTED_OUTLINE,
GUILD_SOCIAL_TAB_SELECTED,
+ GUILD_SOCIAL_TAB_SELECTED_OUTLINE,
BACKGROUND,
BACKGROUND_GRAY,
SCROLLBAR_GRAY,
@@ -236,7 +249,9 @@ class Theme final : public Palette, public ConfigListener
HIGHLIGHT,
HIGHLIGHT_OUTLINE,
TAB_FLASH,
+ TAB_FLASH_OUTLINE,
TAB_PLAYER_FLASH,
+ TAB_PLAYER_FLASH_OUTLINE,
SHOP_WARNING,
ITEM_EQUIPPED,
ITEM_NOT_EQUIPPED,
@@ -251,9 +266,13 @@ class Theme final : public Palette, public ConfigListener
WHISPER_TAB_OFFLINE,
WHISPER_TAB_OFFLINE_OUTLINE,
WHISPER_TAB_HIGHLIGHTED,
+ WHISPER_TAB_HIGHLIGHTED_OUTLINE,
WHISPER_TAB_OFFLINE_HIGHLIGHTED,
+ WHISPER_TAB_OFFLINE_HIGHLIGHTED_OUTLINE,
WHISPER_TAB_SELECTED,
+ WHISPER_TAB_SELECTED_OUTLINE,
WHISPER_TAB_OFFLINE_SELECTED,
+ WHISPER_TAB_OFFLINE_SELECTED_OUTLINE,
IS,
IS_OUTLINE,
SERVER,
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));
}