Skip to content
Snippets Groups Projects
Commit 3eb69875 authored by moon2's avatar moon2 :speech_balloon:
Browse files

system: add help texts

parent 7b336734
Branches
Tags
1 merge request!738system: add help texts
......@@ -234,12 +234,30 @@ class RestoreMenu(OSMenu):
class ApplicationMenu(RestoreMenu):
def __init__(self, items: List[MenuItem]) -> None:
def __init__(self, items: List[MenuItem], name=None) -> None:
super().__init__(items)
self._button_latch = True
self.input.buttons.app.middle.repeat_enable(1000, 1000)
self._vm = None
self._update_tags()
self._name = name
def get_help(self):
if self._name is None:
ret = f"This is an app launcher menu."
else:
ret = f"This is the app launcher menu of the {self._name} category."
ret += "\n\n" + (
"You can long-press the app button to open a context menu that "
"allows you to delete apps, sort them to the top of the list "
'with the "<3" option or start them automatically at boot with the '
'"boot" option.'
)
ret += "\n\n" + super().get_help()
return ret
def _update_tags(self):
for item in self._items:
......@@ -359,6 +377,16 @@ class MenuItemApplicationMenu(MenuItemForeground):
ctx.restore()
class SystemMenu(RestoreMenu):
def get_help(self):
ret = (
"This is the system menu of flow3r, where you can access the app store, "
"change settings, update your firmware and more!"
)
ret += "\n\n" + super().get_help()
return ret
class MainMenu(SunMenu):
def __init__(self, bundles: Optional[list] = None) -> None:
if bundles:
......@@ -369,6 +397,15 @@ class MainMenu(SunMenu):
self.load_menu(reload_bundles=False)
def get_help(self):
ret = (
"Welcome to flow3r! This is the main menu, where you can select different "
"app categories or download apps and updates and change settings "
"in the System option."
)
ret += "\n\n" + super().get_help()
return ret
def load_menu(self, reload_bundles: bool = True) -> None:
"""
(Re)loads the menu.
......@@ -382,10 +419,9 @@ class MainMenu(SunMenu):
def build_menu_items(self) -> None:
menu_settings = settings.build_menu()
menu_system = RestoreMenu(
menu_system = SystemMenu(
[
MenuItemBack(),
MenuItemLaunchPersistentView("About", About),
MenuItemForeground("Settings", menu_settings),
MenuItemAppLaunch(BundleMetadata("/flash/sys/apps/gr33nhouse")),
MenuItemAppLaunch(BundleMetadata("/flash/sys/apps/updat3r")),
......@@ -394,6 +430,7 @@ class MainMenu(SunMenu):
MenuItemAction("Yeet Local Changes", _yeet_local_changes),
MenuItemAction("Clear Autostart", _clear_autostart),
MenuItemAction("Reboot", machine.reset),
MenuItemLaunchPersistentView("About", About),
],
)
......@@ -405,7 +442,7 @@ class MainMenu(SunMenu):
categories = [
MenuItemApplicationMenu(
kind, ApplicationMenu([MenuItemApplicationBack()] + entries)
kind, ApplicationMenu([MenuItemApplicationBack()] + entries, name=kind)
)
for kind in menu_categories
if (entries := _get_bundle_menu_entries(self._bundles, kind))
......
......@@ -214,6 +214,16 @@ class SettingsMenu(OSMenu):
super().select()
self.captouch_active = onoff_touch_os.value
def get_help(self):
ret = (
"This is the settings menu. Right now it's a bit of a unstructured mix "
"with both user-facing and debug options, apologies! You probably don't "
'want to use "Show FPS", "Debug: ftop" and "Touch Overlay" in regular '
"operation as these may slow down or outright block regular functionality. "
)
ret += "\n\n" + super().get_help()
return ret
SIZE_LARGE = 20
SIZE_SMALL = 15
......
......@@ -45,13 +45,20 @@ class SimpleMenu(MenuController):
item.draw(ctx)
ctx.restore()
def get_help(self):
ret = (
"You can scroll though this menu with the app button left and right. To go "
"back use the os button middle, to go forward use the app button middle."
)
return ret
class OSMenu(SimpleMenu):
def get_help(self):
if self.captouch_active:
ret = (
"You can scroll though this menu by swiping across petals 2 and 8 or by "
"tapping the other top petals or the app button l/r. To go back use "
"tapping the other top petals or the app button left/right. To go back use "
"petals 1 or 9 or the os button middle, to go forward use petals 3 and 7 "
"or the app button middle."
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment