VocabBuilder: Fix and improve non-touch device experience#12030
Conversation
|
testing this, works fine now. Only one minor thing, for consistency, the menu button should both open and close the hamburger menu, right now it can only be opened by it but not closed (and yes I know you can do it with the back button). btw thanks! for fixing it so quickly |
It's done. |
|
that last commit is not strictly necessary (at least on kindle) as there is support for long press there already but I am not really bothered by it either, I was in fact going to say that pressing "Menu" inside that widget was crashing the programme but that technically solves that so... one more thing I just discovered is that the "search" widget does not support back button presses either, you can technically exit it by using focus and selecting cancel but for consistency again, best to map it to "Back" button keys. |
| self.layout = {} | ||
| if Device:hasKeys() then | ||
| self.key_events.Close = { { Device.input.group.Back } } | ||
| self.key_events.Close = { { { "Back", "Menu" } } } |
There was a problem hiding this comment.
@Frenzie bringing your attention here as this might affect other non-touch devices...
There was a problem hiding this comment.
Yes, we would want to maintain the full Back group.
In ButtonDialog (which is used in most places) we did this:
if Device:hasKeys() then
local back_group = util.tableDeepCopy(Device.input.group.Back)
if Device:hasFewKeys() then
table.insert(back_group, "Left")
self.key_events.Close = { { back_group } }
else
table.insert(back_group, "Menu")
self.key_events.Close = { { back_group } }
endThere was a problem hiding this comment.
Changed accordingly.
|
|
|
Oops. Thanks for helping testing. |
| local TitleBar = require("ui/widget/titlebar") | ||
| local ToggleSwitch = require("ui/widget/toggleswitch") | ||
| local UIManager = require("ui/uimanager") | ||
| local util = require("util") |
There was a problem hiding this comment.
Could you move it under WidgetContainer above _, see https://github.com/koreader/koreader-base/wiki/Coding-style#order-of-requires
It seems due to the
FocusManagersetsDirtyself.show_parent or selfwhen it focuses on a target item, the target item does not show focus when the manager has a show_parent.Fix #12026
This change is