Merge pull request #32907 from georgikoemdzhiev/FixPressedIssue

Uncheck 'Pressed' if toggle_mode is unchecked
This commit is contained in:
Rémi Verschelde 2020-07-03 12:01:34 +02:00 committed by GitHub
commit ad04cf0bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -271,6 +271,11 @@ BaseButton::DrawMode BaseButton::get_draw_mode() const {
} }
void BaseButton::set_toggle_mode(bool p_on) { void BaseButton::set_toggle_mode(bool p_on) {
// Make sure to set 'pressed' to false if we are not in toggle mode
if (!p_on) {
set_pressed(false);
}
toggle_mode = p_on; toggle_mode = p_on;
} }