Revert "Added anti drag feature to checkboxes"

This reverts commit 640e1c85badcaff7b8a7dca7c4db56c0d3110cfc.
This commit is contained in:
ArthurSonzogni 2023-11-05 10:27:15 +01:00
parent 718b8fb9a7
commit ae09b3c0f2
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C

View File

@ -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_;
}; };