diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:09 +0300 |
commit | 4fbb944f132eb886a6f5b350e5a14a4fe380aacf (patch) | |
tree | 6df2ed96430610ee7c35a7ca4902bbdade0e8e34 /src/gui/widgets/tabbedarea.cpp | |
parent | 1dc012a3bb44218778568e8f80c4e9b445802195 (diff) | |
download | mv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.gz mv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.bz2 mv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.xz mv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.zip |
Add missing checks into gui.
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index b6b0eceb4..33f07efe8 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -455,28 +455,25 @@ void TabbedArea::widgetResized(const Event &event A_UNUSED) - mWidgetContainer->getY() - widgetFrameSize; Widget *const w = getCurrentWidget(); - if (w) + ScrollArea *const scr = dynamic_cast<ScrollArea *const>(w); + if (scr) { - ScrollArea *const scr = dynamic_cast<ScrollArea *const>(w); - if (scr) + if (mFollowDownScroll && height != 0) { - if (mFollowDownScroll && height != 0) + const Rect &rect = w->getDimension(); + if (rect.height != 0 && rect.height > height + 2) { - const Rect &rect = w->getDimension(); - if (rect.height != 0 && rect.height > height + 2) + if (scr->getVerticalScrollAmount() + >= scr->getVerticalMaxScroll() - 2 + && scr->getVerticalScrollAmount() + <= scr->getVerticalMaxScroll() + 2) { - if (scr->getVerticalScrollAmount() - >= scr->getVerticalMaxScroll() - 2 - && scr->getVerticalScrollAmount() - <= scr->getVerticalMaxScroll() + 2) - { - const int newScroll = scr->getVerticalScrollAmount() - + rect.height - height; - w->setSize(mWidgetContainer->getWidth() - frameSize, - mWidgetContainer->getHeight() - frameSize); - if (newScroll) - scr->setVerticalScrollAmount(newScroll); - } + const int newScroll = scr->getVerticalScrollAmount() + + rect.height - height; + w->setSize(mWidgetContainer->getWidth() - frameSize, + mWidgetContainer->getHeight() - frameSize); + if (newScroll) + scr->setVerticalScrollAmount(newScroll); } } } |