FR: Checkbox Actions
Does your feature request involve difficulty completing a task? Please describe.
Koreader has very deeply nested menus, which makes it tedious to interact with, especially on eink screens which take some time to refresh. This is a very hard problem to solve due to solve due to the sheer options koreader has, this aims to help with entries with checkboxs that open submenus/windows.
Describe the solution you'd like
I think there should be an alternative action on a menu entry to toggle it's checked state rather than opening it's submenu/window. My preferred way would be clicking on the checkbox, but if it's deemed the touch target is too small long press is also an option.
Some examples:
SSH
By far the most common action for me is enabling/disabling it, I very rarely interact with the settings. But I still have to go through the submenu every time which adds two additional clicks. It's also very helpful to know at a glance if ssh is enabled, this just requires adding the checkbox itself:
diff --git a/plugins/SSH.koplugin/main.lua b/plugins/SSH.koplugin/main.lua
index cd1fd58a1..bfc7e68e0 100644
--- a/plugins/SSH.koplugin/main.lua
+++ b/plugins/SSH.koplugin/main.lua
@@ -225,6 +225,7 @@ end
function SSH:addToMainMenu(menu_items)
menu_items.ssh = {
text = _("SSH server"),
+ checked_func = function() return self:isRunning() end,
sub_item_table = {
{
text = _("SSH server"),
Frontlight
I usually have the frontlight disabled and if I do have it enabled I have the level fairly low. This makes most of the interactions it:
- Clicking on it to have the window
- Clicking on toggle
- Closing the window
Toggling the checkbox directly would reduce it to a single step, and if I do find that I need to adjust the level it'll still be the same amount of clicks to open the window and reduce it.
N.B. I also tried just adding the checkbox for this as well:
diff --git a/frontend/ui/elements/common_settings_menu_table.lua b/frontend/ui/elements/common_settings_menu_table.lua
index 05bc8afb9..9dfbfc5d6 100644
--- a/frontend/ui/elements/common_settings_menu_table.lua
+++ b/frontend/ui/elements/common_settings_menu_table.lua
@@ -31,6 +31,7 @@ end
if Device:hasFrontlight() then
common_settings.frontlight = {
text = _("Frontlight"), + checked_func = function() return PowerD:isFrontlightOn() end, callback = function()
UIManager:broadcastEvent(Event:new("ShowFlDialog"))
end,
But it only updates when the menu reopens, does anyone know how to update checked_func from the frontlight window? check_callback_updates_menu doesn't help.
Wi-Fi Connection
This is by far the worst offender. In situations with multiple remembered networks, in order to switch between them I have to disconnect, then press on the action and hope that it shows the list of networks instead of immediately connecting to one of them. I would much rather the checkbox trigger the auto-connect behavior and pressing on the action only show the window without connecting, although I'm not sure how intuitive this behavior is.
I'm not sure about the Frontlight checkbox.
You mean there's a technical difficulty with it?
I mean one more item with inconsistent behavior. A user gets used to: -an item with a checkbox and a submenu - tap to go down, long-press to uncheck (Taps and gestures actions, Profiles auto-exec); -an item with a checkbox only - tap to uncheck, long-press for setting defaults or help or additional action.
This would be new: -an item with a checkbox only - tap to open the dialog, long-press to toggle.
I'd forgotten the context. 😅 The frontlight in the menu already has a checkbox indicating its status.
No, no checkbox currently.
Maybe I am missing something here but these kind of frequent actions are best toggled with gestures bbb651. Why are you not using them?
Actually we have three interaction options for different use cases that roughly map to:
- Frequently used items: Gestures
- In-between area: Quick Menu
- Rarely used items: Menu system