summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:09 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:09 +0300
commit4fbb944f132eb886a6f5b350e5a14a4fe380aacf (patch)
tree6df2ed96430610ee7c35a7ca4902bbdade0e8e34 /src/gui/widgets/tabbedarea.cpp
parent1dc012a3bb44218778568e8f80c4e9b445802195 (diff)
downloadManaVerse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.gz
ManaVerse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.bz2
ManaVerse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.xz
ManaVerse-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.zip
Add missing checks into gui.
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp33
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);
}
}
}