Fix ButtonGroup unpressing
It was possible to unpress a button group that had `allow_unpress = false` using shortcuts. Adjust `BaseButton::shortcut_input` to use the same logic as `BaseButton::on_action_event`.
This commit is contained in:
parent
c0d8d91b15
commit
390aa2a565
1 changed files with 3 additions and 5 deletions
|
@ -366,11 +366,9 @@ void BaseButton::shortcut_input(const Ref<InputEvent> &p_event) {
|
|||
if (toggle_mode) {
|
||||
status.pressed = !status.pressed;
|
||||
|
||||
if (status.pressed) {
|
||||
_unpress_group();
|
||||
if (button_group.is_valid()) {
|
||||
button_group->emit_signal(SNAME("pressed"), this);
|
||||
}
|
||||
_unpress_group();
|
||||
if (button_group.is_valid()) {
|
||||
button_group->emit_signal(SNAME("pressed"), this);
|
||||
}
|
||||
|
||||
_toggled(status.pressed);
|
||||
|
|
Loading…
Add table
Reference in a new issue