summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-12 18:58:13 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-12 18:58:13 +0300
commitc5f980195ebf4e249b8759d660a703803fc3e369 (patch)
tree9e1bc9d0a5b67ee9f3fbe2b6f7e3b48549724465 /src
parent752a02d2990db39dc7f3d193951c9f8375c31889 (diff)
downloadmanaplus-c5f980195ebf4e249b8759d660a703803fc3e369.tar.gz
manaplus-c5f980195ebf4e249b8759d660a703803fc3e369.tar.bz2
manaplus-c5f980195ebf4e249b8759d660a703803fc3e369.tar.xz
manaplus-c5f980195ebf4e249b8759d660a703803fc3e369.zip
fix chat tabs scrolling issue with enabled colors picker.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/tabbedarea.cpp2
-rw-r--r--src/gui/windows/chatwindow.cpp14
-rw-r--r--src/gui/windows/chatwindow.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index dee1640ad..6a579d792 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -485,7 +485,7 @@ void TabbedArea::adjustSize()
maxTabHeight = mTabs[i].first->getHeight();
}
- mTabContainer->setSize(width - 2, maxTabHeight);
+ mTabContainer->setSize(width - mRightMargin, maxTabHeight);
mWidgetContainer->setPosition(0, maxTabHeight);
mWidgetContainer->setSize(width, height - maxTabHeight);
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 64eeb7669..40cf8e294 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -291,6 +291,7 @@ ChatWindow::ChatWindow():
mChatInput->addKeyListener(this);
mCurHist = mHistory.end();
mColorPicker->setVisible(config.getBoolValue("showChatColorsList"));
+ updateTabsMargin();
fillCommands();
if (player_node && player_node->isGM())
@@ -362,6 +363,18 @@ void ChatWindow::loadGMCommands()
mGMLoaded = true;
}
+void ChatWindow::updateTabsMargin()
+{
+ if (mColorPicker->isVisible())
+ {
+ mChatTabs->setRightMargin(mColorPicker->getWidth() + 16 + 8);
+ }
+ else
+ {
+ mChatTabs->setRightMargin(8);
+ }
+}
+
void ChatWindow::adjustTabSize()
{
const gcn::Rectangle area = getChildrenArea();
@@ -381,6 +394,7 @@ void ChatWindow::adjustTabSize()
mChatTabs->setHeight(height);
else
mChatTabs->setHeight(height + inputHeight);
+ updateTabsMargin();
if (showEmotes)
{
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index f9170ac91..648f57cf6 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -340,6 +340,7 @@ class ChatWindow final : public Window,
void loadCommandsFile(const std::string &name);
+ void updateTabsMargin();
typedef std::map<const std::string, WhisperTab*> TabMap;
/** Manage whisper tabs */