mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Keep some menus open when Tap or Hold (#4189)
TouchMenu: added options to menu items with the following defaults:
keep_menu_open = false
hold_keep_menu_open = true
So, default for Tap callback is to close menu, and for Hold callback
to keep menu open.
In both cases, provide the TouchMenu instance as the 1st argument to
the callback functions (instead of a refresh_menu_func I added in #3941)
so the callback can do more things, like closing, refreshing,
changing menu items text and re-ordering...
ReaderZooming: show symbol for default (like it was done for
ReaderFont, ReaderHyphenation...)
TextEditor plugin: update the previously opened files list in real
time, so the menu can be kept open and used as the TextEditor main
interface.
SSH plugin: keep menu open and update the Start/Stop state in real time
ReadTimer plugin: tried to do what feels right (but I don't use it)
Also remove forgotten cp in the move/paste file code
This commit is contained in:
@@ -112,8 +112,7 @@ function ReaderHyphenation:init()
|
||||
-- signal readerrolling to update pos in new height, and redraw page
|
||||
self.ui:handleEvent(Event:new("UpdatePos"))
|
||||
end,
|
||||
hold_may_update_menu = true,
|
||||
hold_callback = function(refresh_menu_func)
|
||||
hold_callback = function(touchmenu_instance)
|
||||
UIManager:show(MultiConfirmBox:new{
|
||||
-- No real need for a way to remove default one, we can just
|
||||
-- toggle between setting a default OR a fallback (if a default
|
||||
@@ -125,13 +124,13 @@ function ReaderHyphenation:init()
|
||||
choice1_callback = function()
|
||||
G_reader_settings:saveSetting("hyph_alg_default", v.filename)
|
||||
G_reader_settings:delSetting("hyph_alg_fallback")
|
||||
if refresh_menu_func then refresh_menu_func() end
|
||||
if touchmenu_instance then touchmenu_instance:updateItems() end
|
||||
end,
|
||||
choice2_text = _("Fallback"),
|
||||
choice2_callback = function()
|
||||
G_reader_settings:saveSetting("hyph_alg_fallback", v.filename)
|
||||
G_reader_settings:delSetting("hyph_alg_default")
|
||||
if refresh_menu_func then refresh_menu_func() end
|
||||
if touchmenu_instance then touchmenu_instance:updateItems() end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user