summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-10 17:06:12 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-10 17:06:12 +0300
commitad46c2e661ec79ff01de0f80955a8446b8c883c7 (patch)
treea9e8897dbe8d5ef78d3b3b011d7707ee2bf00122 /src/gui/windows
parent06ace6f3b67757e09dde16da0f28c0169ed6bc0e (diff)
downloadplus-ad46c2e661ec79ff01de0f80955a8446b8c883c7.tar.gz
plus-ad46c2e661ec79ff01de0f80955a8446b8c883c7.tar.bz2
plus-ad46c2e661ec79ff01de0f80955a8446b8c883c7.tar.xz
plus-ad46c2e661ec79ff01de0f80955a8446b8c883c7.zip
Improve performance in chat window.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp15
-rw-r--r--src/gui/windows/chatwindow.h2
2 files changed, 6 insertions, 11 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 1a36f7a83..06e9da844 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -105,6 +105,8 @@ ChatWindow::ChatWindow() :
mHighlights(),
mGlobalsFilter(),
mChatColor(config.getIntValue("chatColor")),
+ mEmoteButtonSpacing(mSkin ? mSkin->getOption("emoteButtonSpacing", 2) : 2),
+ mEmoteButtonY(mSkin ? mSkin->getOption("emoteButtonY", -2) : -2),
mChatHistoryIndex(0),
mReturnToggles(config.getBoolValue("ReturnToggles")),
mGMLoaded(false),
@@ -279,17 +281,8 @@ void ChatWindow::adjustTabSize()
const int chatButtonSize = 20;
int w = awFrame2 - chatButtonSize;
const int x = aw - frame - chatButtonSize;
- if (mSkin)
- {
- const int ipad = mSkin->getOption("emoteButtonSpacing", 2);
- w -= ipad;
- y += mSkin->getOption("emoteButtonY", -2);
- }
- else
- {
- w -= 2;
- y -= 2;
- }
+ w -= mEmoteButtonSpacing;
+ y += mEmoteButtonY;
mChatInput->setWidth(w);
mChatButton->setVisible(mChatInput->isVisibleLocal());
mChatButton->setPosition(x, y);
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index c6f9c0d43..90c743284 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -399,6 +399,8 @@ class ChatWindow final : public Window,
StringVect mHighlights;
StringVect mGlobalsFilter;
int mChatColor;
+ int mEmoteButtonSpacing;
+ int mEmoteButtonY;
unsigned int mChatHistoryIndex;
bool mReturnToggles; // Marks whether <Return> toggles the chat log
// or not