diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-21 02:02:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-21 03:06:54 +0300 |
commit | 59e4495082d3911d9adae6d7ed66586279e45e84 (patch) | |
tree | 19c29a56fcb36fa625bb556b5a5b44fa2e2a31cf /src/gui/widgets/tabbedarea.cpp | |
parent | 4186890210ab662eea6b30e26d78bd4303a33413 (diff) | |
download | mv-59e4495082d3911d9adae6d7ed66586279e45e84.tar.gz mv-59e4495082d3911d9adae6d7ed66586279e45e84.tar.bz2 mv-59e4495082d3911d9adae6d7ed66586279e45e84.tar.xz mv-59e4495082d3911d9adae6d7ed66586279e45e84.zip |
Fix chat scrolling after tabbed area changes.
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 26 |
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); + } } } |