Parcourir la source

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.
grorp il y a 3 semaines
Parent
commit
a8af0c0ca4
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      src/gui/touchscreengui.cpp

+ 3 - 1
src/gui/touchscreengui.cpp

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