From 775d6f983a18457b82747ac6c53123f84629ede5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 20 Sep 2016 17:53:22 +0300 Subject: Add support for unselectable widgets. If move mouse over or try to select, this widget will be ignored. Set labels unselectable by default. Set unselectable tabs in debug window. --- src/gui/gui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 8f643282b..17c3558ae 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1230,6 +1230,7 @@ Widget* Gui::getWidgetAt(const int x, const int y) const // If the widget's parent has no child then we have found the widget.. Widget* parent = mTop; Widget* child = mTop; + Widget* selectable = mTop; while (child) { @@ -1238,9 +1239,11 @@ Widget* Gui::getWidgetAt(const int x, const int y) const parent->getAbsolutePosition(parentX, parentY); child = parent->getWidgetAt(x - parentX, y - parentY); parent = swap; + if (parent && parent->isSelectable()) + selectable = parent; } - return parent; + return selectable; } Widget* Gui::getMouseEventSource(const int x, const int y) const -- cgit v1.2.3-60-g2f50