From 7549b7c7286197be5f29ab5f2f919e0404e58e97 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 4 Sep 2017 22:30:13 +0300 Subject: Fix drawing emotes button in chat input field. --- src/gui/windows/chatwindow.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/gui/windows/chatwindow.cpp') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 25c85638a..9728fe52f 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -279,13 +279,20 @@ void ChatWindow::adjustTabSize() const int ah = area.height; const int frame = mChatInput->getFrameSize(); const int inputHeight = mChatInput->getHeight(); + const bool showEmotes = config.getBoolValue("showEmotesButton"); + int maxHeight = inputHeight; + if (showEmotes) + { + const int buttonHeight = mChatButton->getHeight(); + if (buttonHeight > maxHeight) + maxHeight = buttonHeight; + } const int frame2 = 2 * frame; const int awFrame2 = aw - frame2; - const bool showEmotes = config.getBoolValue("showEmotesButton"); - int y = ah - inputHeight - frame; + int y = ah - maxHeight - frame; mChatInput->setPosition(frame, y); mChatTabs->setWidth(awFrame2); - const int height = ah - frame2 - (inputHeight + frame2); + const int height = ah - frame2 - (maxHeight + frame2); if (mChatInput->mVisible == Visible_true || !config.getBoolValue("hideChatInput")) { @@ -293,13 +300,13 @@ void ChatWindow::adjustTabSize() } else { - mChatTabs->setHeight(height + inputHeight); + mChatTabs->setHeight(height + maxHeight); } updateTabsMargin(); if (showEmotes) { - const int chatButtonSize = 20; + const int chatButtonSize = mChatButton->getWidth(); int w = awFrame2 - chatButtonSize; const int x = aw - frame - chatButtonSize; w -= mEmoteButtonSpacing; -- cgit v1.2.3-60-g2f50