summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-21 02:02:48 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-21 03:06:54 +0300
commit59e4495082d3911d9adae6d7ed66586279e45e84 (patch)
tree19c29a56fcb36fa625bb556b5a5b44fa2e2a31cf /src/gui/widgets
parent4186890210ab662eea6b30e26d78bd4303a33413 (diff)
downloadmanaverse-59e4495082d3911d9adae6d7ed66586279e45e84.tar.gz
manaverse-59e4495082d3911d9adae6d7ed66586279e45e84.tar.bz2
manaverse-59e4495082d3911d9adae6d7ed66586279e45e84.tar.xz
manaverse-59e4495082d3911d9adae6d7ed66586279e45e84.zip
Fix chat scrolling after tabbed area changes.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/tabbedarea.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 869956744..39dfade9a 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -365,7 +365,6 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED)
gcn::Widget *const w = getCurrentWidget();
if (w)
{
- int newScroll = 0;
ScrollArea* scr = dynamic_cast<ScrollArea*>(w);
if (scr)
{
@@ -379,14 +378,16 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED)
&& scr->getVerticalScrollAmount()
<= scr->getVerticalMaxScroll() + 2)
{
- newScroll = scr->getVerticalScrollAmount()
+ int newScroll = scr->getVerticalScrollAmount()
+ rect.height - height;
+ w->setSize(mWidgetContainer->getWidth() - frameSize,
+ mWidgetContainer->getHeight() - frameSize);
+ if (newScroll)
+ scr->setVerticalScrollAmount(newScroll);
}
}
}
}
- if (scr && newScroll)
- scr->setVerticalScrollAmount(newScroll);
}
if (mArrowButton[1])
@@ -455,15 +456,18 @@ void TabbedArea::adjustSize()
mWidgetContainer->setPosition(0, maxTabHeight);
mWidgetContainer->setSize(getWidth(), getHeight() - maxTabHeight);
- gcn::Widget *const w = getCurrentWidget();
- if (w)
+ if (!mFollowDownScroll)
{
- const int wFrameSize = w->getFrameSize();
- const int frame2 = 2 * wFrameSize;
+ gcn::Widget *const w = getCurrentWidget();
+ if (w)
+ {
+ const int wFrameSize = w->getFrameSize();
+ const int frame2 = 2 * wFrameSize;
- w->setPosition(wFrameSize, wFrameSize);
- w->setSize(mWidgetContainer->getWidth() - frame2,
- mWidgetContainer->getHeight() - frame2);
+ w->setPosition(wFrameSize, wFrameSize);
+ w->setSize(mWidgetContainer->getWidth() - frame2,
+ mWidgetContainer->getHeight() - frame2);
+ }
}
}