Skip to content

Intuitive Menu Navigation for Mobile (Add "Back" Button) + Buildozer portability#589

Merged
joeraz merged 4 commits into
shlomif:masterfrom
bwrightkc:menu-cleanup
Jul 22, 2026
Merged

Intuitive Menu Navigation for Mobile (Add "Back" Button) + Buildozer portability#589
joeraz merged 4 commits into
shlomif:masterfrom
bwrightkc:menu-cleanup

Conversation

@bwrightkc

Copy link
Copy Markdown
Contributor

On the mobile/Kivy UI, opening a menu, then opening a submenu, then tapping the menu button again would stack a second menu panel side-by-side with the first instead of replacing it.

The fix: only one navigational panel (main menu, a submenu, the game picker, help, or about) is ever shown at a time. Opening a new one now automatically closes whatever panel was already open, so navigation always feels like moving to a new screen rather than piling windows up. Confirmation dialogs/notes are unaffected and still will appear next to the menu.

Adds feature requested in #551

Also added a "< Back" entry at the top of every submenu, so you can jump straight back to the main menu without needing to close the submenu and tap the hamburger icon again.

Separately, fixed two small portability bugs in the buildozer/ build scripts that broke Android builds on macOS. Mainly sed -i doesn't function quite the same on macOS.

Requesting people to test this prior to potential merge.

@bwrightkc

Copy link
Copy Markdown
Contributor Author
Screenshot_20260721_092341

@joeraz

joeraz commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

A good start, but there are a couple bugs I found:

  • There is no back button on the Games menu.
  • Clicking the Statistics menu causes a crash. The stack trace is as follows:
 Traceback (most recent call last):
   File "\PySolFC\pysol.py", line 41, in <module>
     sys.exit(main(sys.argv))
              ~~~~^^^^^^^^^^
   File "\PySolFC\pysollib\main.py", line 462, in main
     LApp(args).run()
     ~~~~~~~~~~~~~~^^
   File "\Python313\Lib\site-packages\kivy\app.py", line 956, in run
     runTouchApp()
     ~~~~~~~~~~~^^
   File "\Python313\Lib\site-packages\kivy\base.py", line 574, in runTouchApp
     EventLoop.mainloop()
     ~~~~~~~~~~~~~~~~~~^^
   File "\Python313\Lib\site-packages\kivy\base.py", line 339, in mainloop
     self.idle()
     ~~~~~~~~~^^
   File "\Python313\Lib\site-packages\kivy\base.py", line 379, in idle
     Clock.tick()
     ~~~~~~~~~~^^
   File "\Python313\Lib\site-packages\kivy\clock.py", line 733, in tick
     self.post_idle(ts, self.idle())
     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
   File "\Python313\Lib\site-packages\kivy\clock.py", line 776, in post_idle
     self._process_events()
     ~~~~~~~~~~~~~~~~~~~~^^
   File "kivy\\_clock.pyx", line 620, in kivy._clock.CyClockBase._process_events
   File "kivy\\_clock.pyx", line 653, in kivy._clock.CyClockBase._process_events
   File "kivy\\_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
   File "kivy\\_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
   File "\PySolFC\pysollib\kivy\LApp.py", line 1124, in commandCB
     self.command()
     ~~~~~~~~~~~~^^
   File "\PySolFC\pysollib\kivy\menubar.py", line 88, in auto_close_command
     command()
     ~~~~~~~^^
   File "\PySolFC\pysollib\kivy\menubar.py", line 1973, in mGameMenuDialog
     GameMenuDialog(self, self.top, title=_("Statistics"), app=self.app)
     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "\PySolFC\pysollib\kivy\menubar.py", line 453, in __init__
     super().__init__(
     ~~~~~~~~~~~~~~~~^
         menubar, parent, title, app, **kw)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "\PySolFC\pysollib\kivy\menubar.py", line 234, in __init__
     self.buildTree(tv, None)
     ~~~~~~~~~~~~~~^^^^^^^^^^
   File "\PySolFC\pysollib\kivy\menubar.py", line 464, in buildTree
     self.addBackNode(tv)
     ~~~~~~~~~~~~~~~~^^^^
   File "\PySolFC\pysollib\kivy\menubar.py", line 146, in addBackNode
     command=self.make_command(self.menubar.mMainMenuDialog)))
             ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 TypeError: GameMenuDialog.make_command() missing 1 required positional argument: 'command'

@bwrightkc

Copy link
Copy Markdown
Contributor Author

A good start, but there are a couple bugs I found:

* Clicking the Statistics menu causes a crash.  The stack trace is as follows:
 TypeError: GameMenuDialog.make_command() missing 1 required positional argument: 'command'

Agh! I didn't see make_command() defined differently down there. I'll fix that.

Also adding back button to games menu, and going to make it a translatable string as well.

@joeraz

joeraz commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Seems to be working good now. Are you still making tweaks, or am I good to merge?

@bwrightkc

Copy link
Copy Markdown
Contributor Author

Good to merge

@joeraz
joeraz merged commit e77df95 into shlomif:master Jul 22, 2026
14 checks passed
@joeraz

joeraz commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants