Close buttonbars when hiding TouchScreenGUI (#14630)

To open the inventory or the pause menu, you first need to open the buttonbar
containing the respective button. Before this commit, the buttonbar is still
open after closing the menu, so you have to tap twice before you can continue
playing. After this commit, the buttonbar is already closed after closing the
menu, so you only have to tap once before you can continue playing.
This commit is contained in:
grorp 2024-05-10 18:54:22 +02:00 committed by GitHub
parent 07fe8d4481
commit a8af0c0ca4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -857,8 +857,10 @@ void TouchScreenGUI::setVisible(bool visible)
if (!visible) {
while (!m_pointer_pos.empty())
handleReleaseEvent(m_pointer_pos.begin()->first);
for (AutoHideButtonBar &bar : m_buttonbars)
for (AutoHideButtonBar &bar : m_buttonbars) {
bar.deactivate();
bar.hide();
}
} else {
for (AutoHideButtonBar &bar : m_buttonbars)
bar.show();