Fix drag-background-through-buttons problem by adding "touch exclusive" mode to viewgroups.

Not using universally because I don't want to debug all the issues...
This commit is contained in:
Henrik Rydgård
2022-11-27 16:16:18 +01:00
parent d310636eb4
commit 0a3d78221e
9 changed files with 111 additions and 64 deletions
+3 -2
View File
@@ -359,7 +359,7 @@ public:
: UI::AnchorLayout(layoutParams) {
}
void Touch(const TouchInput &input) override;
bool Touch(const TouchInput &input) override;
void CreateViews();
bool HasCreatedViews() const {
return !controls_.empty();
@@ -384,7 +384,7 @@ static Point ClampTo(const Point &p, const Bounds &b) {
return Point(clamp_value(p.x, b.x, b.x + b.w), clamp_value(p.y, b.y, b.y + b.h));
}
void ControlLayoutView::Touch(const TouchInput &touch) {
bool ControlLayoutView::Touch(const TouchInput &touch) {
using namespace UI;
if ((touch.flags & TOUCH_MOVE) && pickedControl_ != nullptr) {
@@ -452,6 +452,7 @@ void ControlLayoutView::Touch(const TouchInput &touch) {
pickedControl_->SavePosition();
pickedControl_ = 0;
}
return true;
}
void ControlLayoutView::CreateViews() {