Revert "Prevent drag spamming buttons"

This reverts commit 273b933f2269bb0ae5505e32343b73a211db7ea1.
This commit is contained in:
ArthurSonzogni 2023-11-05 10:27:20 +01:00
parent 07a0aa7a1b
commit 7f26b823ff
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C

View File

@ -50,11 +50,6 @@ class ButtonBase : public ComponentBase, public ButtonOption {
} }
auto focus_management = focused ? focus : active ? select : nothing; auto focus_management = focused ? focus : active ? select : nothing;
if (focus_management == nothing) {
isMousePressed = false;
}
const EntryState state = { const EntryState state = {
*label, *label,
false, false,
@ -130,16 +125,9 @@ class ButtonBase : public ComponentBase, public ButtonOption {
} }
if (event.mouse().button == Mouse::Left && if (event.mouse().button == Mouse::Left &&
event.mouse().motion == Mouse::Pressed && isMousePressed == false) { event.mouse().motion == Mouse::Pressed) {
TakeFocus(); TakeFocus();
OnClick(); OnClick();
isMousePressed = true;
return true;
}
if(event.mouse().button == Mouse::Left &&
event.mouse().motion == Mouse::Released) {
isMousePressed = false;
return true; return true;
} }
@ -149,7 +137,6 @@ class ButtonBase : public ComponentBase, public ButtonOption {
bool Focusable() const final { return true; } bool Focusable() const final { return true; }
private: private:
bool isMousePressed = false;
bool mouse_hover_ = false; bool mouse_hover_ = false;
Box box_; Box box_;
ButtonOption option_; ButtonOption option_;