diff options
author | Thierry Crozat | 2018-07-23 23:34:01 +0100 |
---|---|---|
committer | Thierry Crozat | 2018-07-24 00:27:11 +0100 |
commit | f7a4b74130fa1f02c64811dd4d14f257512e861b (patch) | |
tree | a4575fabb6923b06be4a12e635fcd36a8fbf5be4 /gui | |
parent | bb2f218fa1a8df056626bda9b96aa766da608b38 (diff) | |
download | scummvm-rg350-f7a4b74130fa1f02c64811dd4d14f257512e861b.tar.gz scummvm-rg350-f7a4b74130fa1f02c64811dd4d14f257512e861b.tar.bz2 scummvm-rg350-f7a4b74130fa1f02c64811dd4d14f257512e861b.zip |
GUI: Fix container widgets not receiving events
Diffstat (limited to 'gui')
-rw-r--r-- | gui/widget.cpp | 5 | ||||
-rw-r--r-- | gui/widgets/scrollcontainer.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp index 1dfd069f29..2ac73dd4ca 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -748,7 +748,10 @@ bool ContainerWidget::containsWidget(Widget *w) const { } Widget *ContainerWidget::findWidget(int x, int y) { - return findWidgetInChain(_firstWidget, x, y); + Widget *w = findWidgetInChain(_firstWidget, x, y); + if (w) + return w; + return this; } void ContainerWidget::removeWidget(Widget *widget) { diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp index 7994c0078d..33f7e7f754 100644 --- a/gui/widgets/scrollcontainer.cpp +++ b/gui/widgets/scrollcontainer.cpp @@ -153,7 +153,10 @@ bool ScrollContainerWidget::containsWidget(Widget *w) const { Widget *ScrollContainerWidget::findWidget(int x, int y) { if (_verticalScroll->isVisible() && x >= _w - _verticalScroll->getWidth()) return _verticalScroll; - return Widget::findWidgetInChain(_firstWidget, x + _scrolledX, y + _scrolledY); + Widget *w = Widget::findWidgetInChain(_firstWidget, x + _scrolledX, y + _scrolledY); + if (w) + return w; + return this; } Common::Rect ScrollContainerWidget::getClipRect() const { |