From 219ca3560cf16a3c303b9d88756448a9a2fb19a5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 20 Sep 2016 22:47:09 +0300 Subject: Set scrollarea unselectable only if no scroll bars showed. --- src/gui/widgets/scrollarea.cpp | 7 +++++++ src/gui/widgets/scrollarea.h | 2 ++ src/gui/widgets/widget.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 18b99527d..db44a8a93 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -1446,3 +1446,10 @@ void ScrollArea::checkPolicies() break; } } + +bool ScrollArea::isSelectable() const +{ + if (mVBarVisible || mHBarVisible) + return true; + return Widget::isSelectable(); +} diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 4392f4bcf..351814b79 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -432,6 +432,8 @@ class ScrollArea final : public BasicContainer, void mouseWheelMovedDown(MouseEvent& event) override final; + bool isSelectable() const override final; + protected: enum BUTTON_DIR { diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index 4cae7369e..cbeb68874 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -1023,7 +1023,7 @@ class Widget notfinal : public Widget2 void setRedraw(const bool b) noexcept2 { mRedraw = b; } - bool isSelectable() const noexcept2 A_WARN_UNUSED + virtual bool isSelectable() const A_WARN_UNUSED { return mSelectable; } void setSelectable(const bool selectable) -- cgit v1.2.3-70-g09d2