Make button aware of it being dragged and reset state, closes #4178

This commit is contained in:
Juan Linietsky 2016-06-23 18:20:39 -03:00
parent a8f8f52b19
commit 9e0b6057e7
2 changed files with 10 additions and 1 deletions

View file

@ -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();
}
}

View file

@ -1933,7 +1933,6 @@ void Viewport::_gui_input_event(InputEvent p_event) {
}
if (over!=gui.mouse_over) {
if (gui.mouse_over)