summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-20 17:53:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-20 18:49:07 +0300
commit775d6f983a18457b82747ac6c53123f84629ede5 (patch)
tree7a13a11156825d7186fa2305caf07854893adf0a /src/gui/gui.cpp
parent0cc66ba20aa01f5319fcea108abdca5916c5c61b (diff)
downloadplus-775d6f983a18457b82747ac6c53123f84629ede5.tar.gz
plus-775d6f983a18457b82747ac6c53123f84629ede5.tar.bz2
plus-775d6f983a18457b82747ac6c53123f84629ede5.tar.xz
plus-775d6f983a18457b82747ac6c53123f84629ede5.zip
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.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp5
1 files changed, 4 insertions, 1 deletions
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