From ad46c2e661ec79ff01de0f80955a8446b8c883c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 10 May 2015 17:06:12 +0300 Subject: Improve performance in chat window. --- src/gui/windows/chatwindow.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/gui/windows/chatwindow.cpp') 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); -- cgit v1.2.3-60-g2f50