summaryrefslogtreecommitdiff
path: root/scene/gui/base_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/base_button.cpp')
-rw-r--r--scene/gui/base_button.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index ac067aa001..c1ae0479f5 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -98,17 +98,14 @@ void BaseButton::_notification(int p_what) {
}
if (p_what == NOTIFICATION_FOCUS_ENTER) {
- status.hovering = true;
update();
}
if (p_what == NOTIFICATION_FOCUS_EXIT) {
if (status.press_attempt) {
status.press_attempt = false;
- status.hovering = false;
update();
} else if (status.hovering) {
- status.hovering = false;
update();
}
}
@@ -175,10 +172,9 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) {
status.hovering = false;
}
}
- // pressed state should be correct with button_up signal
- emit_signal("button_up");
status.press_attempt = false;
status.pressing_inside = false;
+ emit_signal("button_up");
}
update();
@@ -395,7 +391,7 @@ bool BaseButton::_is_focus_owner_in_shorcut_context() const {
Control *vp_focus = get_focus_owner();
// If the context is valid and the viewport focus is valid, check if the context is the focus or is a parent of it.
- return ctx_node && vp_focus && (ctx_node == vp_focus || ctx_node->is_a_parent_of(vp_focus));
+ return ctx_node && vp_focus && (ctx_node == vp_focus || ctx_node->is_ancestor_of(vp_focus));
}
void BaseButton::_bind_methods() {