summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-04 22:30:13 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-05 00:05:00 +0300
commit7549b7c7286197be5f29ab5f2f919e0404e58e97 (patch)
treed084c4dcc45e06580c1ba55420bbab8e3201e1b3 /src
parent6f8464ef02108c2da2e99192a834b7cf62220588 (diff)
downloadmanaplus-7549b7c7286197be5f29ab5f2f919e0404e58e97.tar.gz
manaplus-7549b7c7286197be5f29ab5f2f919e0404e58e97.tar.bz2
manaplus-7549b7c7286197be5f29ab5f2f919e0404e58e97.tar.xz
manaplus-7549b7c7286197be5f29ab5f2f919e0404e58e97.zip
Fix drawing emotes button in chat input field.
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/chatwindow.cpp17
1 files changed, 12 insertions, 5 deletions
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;