mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-07-04 15:11:14 +08:00
Revert "Added anti drag feature to checkboxes"
This reverts commit 640e1c85badcaff7b8a7dca7c4db56c0d3110cfc.
This commit is contained in:
parent
718b8fb9a7
commit
ae09b3c0f2
@ -70,25 +70,17 @@ class CheckboxBase : public ComponentBase, public CheckboxOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.mouse().button == Mouse::Left &&
|
if (event.mouse().button == Mouse::Left &&
|
||||||
event.mouse().motion == Mouse::Pressed &&
|
event.mouse().motion == Mouse::Pressed) {
|
||||||
isMousePressed == false) {
|
|
||||||
*checked = !*checked;
|
*checked = !*checked;
|
||||||
isMousePressed = true;
|
|
||||||
on_change();
|
on_change();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.mouse().button == Mouse::Left &&
|
|
||||||
event.mouse().motion == Mouse::Released) {
|
|
||||||
isMousePressed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Focusable() const final { return true; }
|
bool Focusable() const final { return true; }
|
||||||
|
|
||||||
bool isMousePressed = false;
|
|
||||||
bool hovered_ = false;
|
bool hovered_ = false;
|
||||||
Box box_;
|
Box box_;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user