summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-08-10 20:53:07 -0600
committerJared Adams <jaxad0127@gmail.com>2009-08-10 20:53:07 -0600
commit3a23f6a771142b6dc3df361b88621eec31d4e40f (patch)
tree7364a138e37b96ced7363a1be010fea70b280e3e /src/gui/chat.cpp
parent843fbb7fac79d1e0340fe489e8e78e4a41b3da43 (diff)
downloadmana-3a23f6a771142b6dc3df361b88621eec31d4e40f.tar.gz
mana-3a23f6a771142b6dc3df361b88621eec31d4e40f.tar.bz2
mana-3a23f6a771142b6dc3df361b88621eec31d4e40f.tar.xz
mana-3a23f6a771142b6dc3df361b88621eec31d4e40f.zip
Remove layout code from ChatWindow
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp48
1 files changed, 4 insertions, 44 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index be302dc3..4cabf92e 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -98,10 +98,10 @@ ChatWindow::ChatWindow():
mChatTabs = new TabbedArea;
- //place(0, 0, mChatTabs, 3, 3);
- //place(0, 3, mChatInput, 3);
- add(mChatTabs);
- add(mChatInput);
+ place(0, 0, mChatTabs, 3, 3);
+ place(0, 3, mChatInput, 3);
+ //add(mChatTabs);
+ //add(mChatInput);
loadWindowState();
@@ -128,41 +128,6 @@ void ChatWindow::resetToDefaultSize()
Window::resetToDefaultSize();
}
-void ChatWindow::adjustTabSize()
-{
- //return;
- const gcn::Rectangle area = getChildrenArea();
-
- mChatInput->setPosition(mChatInput->getFrameSize(),
- area.height - mChatInput->getHeight() -
- mChatInput->getFrameSize());
- mChatInput->setWidth(area.width - 2 * mChatInput->getFrameSize());
-
- mChatTabs->setWidth(area.width - 2 * mChatTabs->getFrameSize());
- mChatTabs->setHeight(area.height - 2 * mChatTabs->getFrameSize() -
- (mChatInput->getHeight() + mChatInput->getFrameSize() * 2));
-
- ChatTab *tab = getFocused();
- if (tab) {
- gcn::Widget *content = tab->mScrollArea;
- bool scrollLock = false;
- if(tab->mScrollArea->getVerticalMaxScroll() == tab->mScrollArea->getVerticalScrollAmount())
- scrollLock = true;
- content->setSize(mChatTabs->getWidth() - 2 * content->getFrameSize(),
- mChatTabs->getContainerHeight() - 2 * content->getFrameSize());
- content->logic();
- if(scrollLock)
- tab->mScrollArea->setVerticalScrollAmount(tab->mScrollArea->getVerticalMaxScroll());
- }
-}
-
-void ChatWindow::widgetResized(const gcn::Event &event)
-{
- Window::widgetResized(event);
-
- adjustTabSize();
-}
-
void ChatWindow::logic()
{
Window::logic();
@@ -170,7 +135,6 @@ void ChatWindow::logic()
Tab *tab = getFocused();
if (tab != mCurrentTab) {
mCurrentTab = tab;
- adjustTabSize();
}
}
@@ -294,10 +258,6 @@ void ChatWindow::addTab(ChatTab *tab)
mChatTabs->addTab(tab, tab->mScrollArea);
- // Fix for layout issues when adding the first tab
- if (tab == localChatTab)
- adjustTabSize();
-
// Update UI
logic();
}