diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-08 15:17:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-08 15:28:43 +0300 |
commit | c5a64309d9d792fc4ee3218f4db902e8a846a18a (patch) | |
tree | 08618c439436faa4f5265f4967a426b44fa79889 | |
parent | 58b4f0bc45f9b866899db035664378969e583b01 (diff) | |
download | mv-c5a64309d9d792fc4ee3218f4db902e8a846a18a.tar.gz mv-c5a64309d9d792fc4ee3218f4db902e8a846a18a.tar.bz2 mv-c5a64309d9d792fc4ee3218f4db902e8a846a18a.tar.xz mv-c5a64309d9d792fc4ee3218f4db902e8a846a18a.zip |
Add new colors for whisper tabs.
New colors: WHISPER_TAB_HIGHLIGHTED, WHISPER_TAB_OFFLINE_HIGHLIGHTED,
WHISPER_TAB_SELECTED, WHISPER_TAB_OFFLINE_SELECTED
-rw-r--r-- | data/graphics/gui/colors.xml | 4 | ||||
-rw-r--r-- | data/themes/blacknblack/colors.xml | 4 | ||||
-rw-r--r-- | data/themes/blackwood/colors.xml | 4 | ||||
-rw-r--r-- | data/themes/enchilado/colors.xml | 4 | ||||
-rw-r--r-- | data/themes/mana/colors.xml | 4 | ||||
-rw-r--r-- | data/themes/pink/colors.xml | 4 | ||||
-rw-r--r-- | data/themes/unity/colors.xml | 4 | ||||
-rw-r--r-- | data/themes/wood/colors.xml | 4 | ||||
-rw-r--r-- | src/gui/chatwindow.cpp | 26 | ||||
-rw-r--r-- | src/gui/chatwindow.h | 8 | ||||
-rw-r--r-- | src/gui/theme.cpp | 4 | ||||
-rw-r--r-- | src/gui/theme.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/whispertab.cpp | 19 | ||||
-rw-r--r-- | src/gui/widgets/whispertab.h | 6 | ||||
-rw-r--r-- | src/localplayer.cpp | 6 |
16 files changed, 82 insertions, 25 deletions
diff --git a/data/graphics/gui/colors.xml b/data/graphics/gui/colors.xml index 98949696a..8652713f3 100644 --- a/data/graphics/gui/colors.xml +++ b/data/graphics/gui/colors.xml @@ -45,6 +45,10 @@ <color id="PLAYER" color="#003000" /> <color id="WHISPER_TAB" color="#0000ff" /> <color id="WHISPER_TAB_OFFLINE" color="#000050" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#000050" /> + <color id="WHISPER_TAB_SELECTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#000050" /> <color id="IS" color="#705000" /> <color id="SERVER" color="#8415e2" /> <color id="LOGGER" color="#919191" /> diff --git a/data/themes/blacknblack/colors.xml b/data/themes/blacknblack/colors.xml index b4f2382f8..68776cf47 100644 --- a/data/themes/blacknblack/colors.xml +++ b/data/themes/blacknblack/colors.xml @@ -45,6 +45,10 @@ <color id="PLAYER" color="#ffffff" /> <color id="WHISPER_TAB" color="#55ffff" /> <color id="WHISPER_TAB_OFFLINE" color="#ff5044" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#55ffff" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#ff5044" /> + <color id="WHISPER_TAB_SELECTED" color="#55ffff" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#ff5044" /> <color id="IS" color="#ffff99" /> <color id="SERVER" color="#8415e2" /> <color id="LOGGER" color="#919191" /> diff --git a/data/themes/blackwood/colors.xml b/data/themes/blackwood/colors.xml index 27293f1cb..03ba51864 100644 --- a/data/themes/blackwood/colors.xml +++ b/data/themes/blackwood/colors.xml @@ -45,6 +45,10 @@ <color id="PLAYER" color="#00ff00" /> <color id="WHISPER_TAB" color="#0000ff" /> <color id="WHISPER_TAB_OFFLINE" color="#0000e0" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#0000e0" /> + <color id="WHISPER_TAB_SELECTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#0000e0" /> <color id="IS" color="#a08527" /> <color id="SERVER" color="#8415e2" /> <color id="LOGGER" color="#919191" /> diff --git a/data/themes/enchilado/colors.xml b/data/themes/enchilado/colors.xml index 86960ef64..a98ea738c 100644 --- a/data/themes/enchilado/colors.xml +++ b/data/themes/enchilado/colors.xml @@ -45,6 +45,10 @@ <color id="PLAYER" color="#009000" /> <color id="WHISPER_TAB" color="#0000ff" /> <color id="WHISPER_TAB_OFFLINE" color="#000050" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#000050" /> + <color id="WHISPER_TAB_SELECTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#000050" /> <color id="IS" color="#705000" /> <color id="SERVER" color="#8415e2" /> <color id="LOGGER" color="#919191" /> diff --git a/data/themes/mana/colors.xml b/data/themes/mana/colors.xml index 3001db556..3e99304f5 100644 --- a/data/themes/mana/colors.xml +++ b/data/themes/mana/colors.xml @@ -45,6 +45,10 @@ <color id="PLAYER" color="#003000" /> <color id="WHISPER_TAB" color="#0000ff" /> <color id="WHISPER_TAB_OFFLINE" color="#000050" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#000050" /> + <color id="WHISPER_TAB_SELECTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#000050" /> <color id="IS" color="#a08527" /> <color id="SERVER" color="#8415e2" /> <color id="LOGGER" color="#919191" /> diff --git a/data/themes/pink/colors.xml b/data/themes/pink/colors.xml index 0360a012c..55772c7a5 100644 --- a/data/themes/pink/colors.xml +++ b/data/themes/pink/colors.xml @@ -45,6 +45,10 @@ <color id="PLAYER" color="#009000" /> <color id="WHISPER_TAB" color="#0000ff" /> <color id="WHISPER_TAB_OFFLINE" color="#000050" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#000050" /> + <color id="WHISPER_TAB_SELECTED" color="#0000ff" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#000050" /> <color id="IS" color="#705000" /> <color id="SERVER" color="#8415e2" /> <color id="LOGGER" color="#919191" /> diff --git a/data/themes/unity/colors.xml b/data/themes/unity/colors.xml index a390bad8f..62035e813 100644 --- a/data/themes/unity/colors.xml +++ b/data/themes/unity/colors.xml @@ -43,6 +43,10 @@ <color id="PLAYER" color="#66CCCC" /> <color id="WHISPER_TAB" color="#E0E0E0" /> <color id="WHISPER_TAB_OFFLINE" color="#A8A8A8" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#E0E0E0" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#A8A8A8" /> + <color id="WHISPER_TAB_SELECTED" color="#E0E0E0" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#A8A8A8" /> <color id="IS" color="#70C600" /> <color id="SERVER" color="#9966FF" /> <color id="LOGGER" color="#9966FF" /> diff --git a/data/themes/wood/colors.xml b/data/themes/wood/colors.xml index 2f7c5917d..ea337c0b8 100644 --- a/data/themes/wood/colors.xml +++ b/data/themes/wood/colors.xml @@ -45,6 +45,10 @@ <color id="PLAYER" color="#003000" /> <color id="WHISPER_TAB" color="#00feaf" /> <color id="WHISPER_TAB_OFFLINE" color="#000a40" /> + <color id="WHISPER_TAB_HIGHLIGHTED" color="#00feaf" /> + <color id="WHISPER_TAB_OFFLINE_HIGHLIGHTED" color="#000a40" /> + <color id="WHISPER_TAB_SELECTED" color="#00feaf" /> + <color id="WHISPER_TAB_OFFLINE_SELECTED" color="#000a40" /> <color id="IS" color="#006000" /> <color id="SERVER" color="#8415e2" /> <color id="LOGGER" color="#919191" /> diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 2aaa0da2d..7a8c3d63b 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -1025,7 +1025,7 @@ void ChatWindow::addWhisper(const std::string &nick, if (tempNick.compare(playerName) == 0) return; - ChatTab *tab = nullptr; + WhisperTab *tab = nullptr; const TabMap::const_iterator i = mWhispers.find(tempNick); if (i != mWhispers.end()) @@ -1099,8 +1099,8 @@ void ChatWindow::addWhisper(const std::string &nick, } } -ChatTab *ChatWindow::addWhisperTab(const std::string &nick, - const bool switchTo) +WhisperTab *ChatWindow::addWhisperTab(const std::string &nick, + const bool switchTo) { if (!player_node) return nullptr; @@ -1112,7 +1112,7 @@ ChatTab *ChatWindow::addWhisperTab(const std::string &nick, toLower(tempNick); const TabMap::const_iterator i = mWhispers.find(tempNick); - ChatTab *ret; + WhisperTab *ret; if (tempNick.compare(playerName) == 0) return nullptr; @@ -1137,7 +1137,7 @@ ChatTab *ChatWindow::addWhisperTab(const std::string &nick, return ret; } -ChatTab *ChatWindow::getWhisperTab(const std::string &nick) const +WhisperTab *ChatWindow::getWhisperTab(const std::string &nick) const { if (!player_node) return nullptr; @@ -1149,7 +1149,7 @@ ChatTab *ChatWindow::getWhisperTab(const std::string &nick) const toLower(tempNick); const TabMap::const_iterator i = mWhispers.find(tempNick); - ChatTab *ret = nullptr; + WhisperTab *ret = nullptr; if (tempNick.compare(playerName) == 0) return nullptr; @@ -1479,7 +1479,7 @@ void ChatWindow::updateOnline(std::set<std::string> &onlinePlayers) if (onlinePlayers.find(tab->getNick()) != onlinePlayers.end()) { - tab->setTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB)); + tab->setWhisperTabColors(); } else { @@ -1490,8 +1490,7 @@ void ChatWindow::updateOnline(std::set<std::string> &onlinePlayers) nick, ActorSprite::PLAYER); if (being) { - tab->setTabColor(&Theme::getThemeColor( - Theme::WHISPER_TAB)); + tab->setWhisperTabColors(); continue; } } @@ -1500,8 +1499,7 @@ void ChatWindow::updateOnline(std::set<std::string> &onlinePlayers) const PartyMember *const pm = party->getMember(nick); if (pm && pm->getOnline()) { - tab->setTabColor(&Theme::getThemeColor( - Theme::WHISPER_TAB)); + tab->setWhisperTabColors(); continue; } } @@ -1510,13 +1508,11 @@ void ChatWindow::updateOnline(std::set<std::string> &onlinePlayers) const GuildMember *const gm = guild->getMember(nick); if (gm && gm->getOnline()) { - tab->setTabColor(&Theme::getThemeColor( - Theme::WHISPER_TAB)); + tab->setWhisperTabColors(); continue; } } - tab->setTabColor(&Theme::getThemeColor( - Theme::WHISPER_TAB_OFFLINE)); + tab->setWhisperTabOfflineColors(); } } } diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index 4f65ed44d..4d4b249e6 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -227,10 +227,10 @@ class ChatWindow : public Window, void addWhisper(const std::string &nick, const std::string &mes, const Own own = BY_OTHER); - ChatTab *addWhisperTab(const std::string &nick, - const bool switchTo = false); + WhisperTab *addWhisperTab(const std::string &nick, + const bool switchTo = false); - ChatTab *getWhisperTab(const std::string &nick) const; + WhisperTab *getWhisperTab(const std::string &nick) const; void removeAllWhispers(); @@ -332,7 +332,7 @@ class ChatWindow : public Window, bool mTmpVisible; - typedef std::map<const std::string, ChatTab*> TabMap; + typedef std::map<const std::string, WhisperTab*> TabMap; /** Manage whisper tabs */ TabMap mWhispers; diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index dd9e616b7..113f313c3 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -717,6 +717,10 @@ static int readColorType(const std::string &type) "PLAYER", "WHISPER_TAB", "WHISPER_TAB_OFFLINE", + "WHISPER_TAB_HIGHLIGHTED", + "WHISPER_TAB_OFFLINEB_HIGHLIGHTED", + "WHISPER_TAB_SELECTED", + "WHISPER_TAB_OFFLINEB_SELECTED", "IS", "SERVER", "LOGGER", diff --git a/src/gui/theme.h b/src/gui/theme.h index a079f720c..cfa9ab49d 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -209,6 +209,10 @@ class Theme : public Palette, public ConfigListener PLAYER, WHISPER_TAB, WHISPER_TAB_OFFLINE, + WHISPER_TAB_HIGHLIGHTED, + WHISPER_TAB_OFFLINE_HIGHLIGHTED, + WHISPER_TAB_SELECTED, + WHISPER_TAB_OFFLINE_SELECTED, IS, SERVER, LOGGER, diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index b54b3d945..805922b2b 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -397,7 +397,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) { if (ava->getType() == AVATAR_PLAYER && chatWindow) { - const ChatTab *const tab = chatWindow->addWhisperTab( + const WhisperTab *const tab = chatWindow->addWhisperTab( model->getAvatarAt(selected)->getName(), true); if (chatWindow && tab) chatWindow->saveState(); diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp index ae034d8d2..cc4db6a87 100644 --- a/src/gui/widgets/whispertab.cpp +++ b/src/gui/widgets/whispertab.cpp @@ -39,7 +39,7 @@ WhisperTab::WhisperTab(const std::string &nick) : ChatTab(nick), mNick(nick) { - setTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB)); + setWhisperTabColors(); } WhisperTab::~WhisperTab() @@ -168,3 +168,20 @@ void WhisperTab::getAutoCompleteList(StringVect &names) const { names.push_back(mNick); } + +void WhisperTab::setWhisperTabColors() +{ + setTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB)); + setHighlightedTabColor(&Theme::getThemeColor( + Theme::WHISPER_TAB_HIGHLIGHTED)); + setSelectedTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB_SELECTED)); +} + +void WhisperTab::setWhisperTabOfflineColors() +{ + setTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB_OFFLINE)); + setHighlightedTabColor(&Theme::getThemeColor( + Theme::WHISPER_TAB_OFFLINE_HIGHLIGHTED)); + setSelectedTabColor(&Theme::getThemeColor( + Theme::WHISPER_TAB_OFFLINE_SELECTED)); +} diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h index 85c670db1..eec66768c 100644 --- a/src/gui/widgets/whispertab.h +++ b/src/gui/widgets/whispertab.h @@ -23,7 +23,7 @@ #ifndef WHISPERTAB_H #define WHISPERTAB_H -#include "chattab.h" +#include "gui/widgets/chattab.h" class Channel; @@ -46,6 +46,10 @@ class WhisperTab : public ChatTab void saveToLogFile(std::string &msg); + void setWhisperTabColors(); + + void setWhisperTabOfflineColors(); + protected: friend class ChatWindow; diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 0521a170d..1dc126c52 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -52,7 +52,7 @@ #include "gui/theme.h" #include "gui/viewport.h" -#include "gui/widgets/chattab.h" +#include "gui/widgets/whispertab.h" #include "net/beinghandler.h" #include "net/chathandler.h" @@ -4162,9 +4162,9 @@ void LocalPlayer::checkNewName(Being *const being) } if (chatWindow) { - ChatTab *const tab = chatWindow->getWhisperTab(nick); + WhisperTab *const tab = chatWindow->getWhisperTab(nick); if (tab) - tab->setTabColor(&Theme::getThemeColor(Theme::WHISPER_TAB)); + tab->setWhisperTabColors(); } } |