Make button aware of it being dragged and reset state, closes #4178
This commit is contained in:
parent
a8f8f52b19
commit
9e0b6057e7
|
@ -225,11 +225,21 @@ void BaseButton::_notification(int p_what) {
|
|||
status.hovering=false;
|
||||
update();
|
||||
}
|
||||
if (p_what==NOTIFICATION_DRAG_BEGIN) {
|
||||
|
||||
if (status.press_attempt) {
|
||||
status.press_attempt=false;
|
||||
status.pressing_button=0;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
if (p_what==NOTIFICATION_FOCUS_EXIT) {
|
||||
|
||||
if (status.pressing_button && status.press_attempt) {
|
||||
status.press_attempt=false;
|
||||
status.pressing_button=0;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1933,7 +1933,6 @@ void Viewport::_gui_input_event(InputEvent p_event) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
if (over!=gui.mouse_over) {
|
||||
|
||||
if (gui.mouse_over)
|
||||
|
|
Loading…
Reference in New Issue