From 8591ff0d0a1ba4cdf70c05b8c6719f2e1cb65348 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Oct 2013 00:31:04 +0300 Subject: add theming parameters for for chat window (chat.xml). New theme parameters: emoteButtonSpacing - space between input chat line and emote button. Default 2 emoteButtonY - relative y position for emote button. Default -2 --- src/gui/windows/chatwindow.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/gui/windows') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 09685e88d..b806a33da 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -372,10 +372,9 @@ void ChatWindow::adjustTabSize() const int frame2 = 2 * frame; const int awFrame2 = aw - frame2; const bool showEmotes = config.getBoolValue("showEmotesButton"); - const int chatButtonSize = showEmotes ? 20 : 0; - const int y = ah - inputHeight - frame; + const int chatButtonSize = 20; + int y = ah - inputHeight - frame; mChatInput->setPosition(frame, y); - mChatInput->setWidth(awFrame2 - chatButtonSize); mChatTabs->setWidth(awFrame2); const int height = ah - frame2 - (inputHeight + frame2); if (mChatInput->isVisible() || !config.getBoolValue("hideChatInput")) @@ -385,8 +384,22 @@ void ChatWindow::adjustTabSize() if (showEmotes) { + int w = awFrame2 - chatButtonSize; + 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; + } + mChatInput->setWidth(w); mChatButton->setVisible(mChatInput->isVisible()); - mChatButton->setPosition(aw - frame - chatButtonSize, y); + mChatButton->setPosition(x, y); } else { -- cgit v1.2.3-70-g09d2