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:
@@ -338,7 +338,6 @@ function ReaderStyleTweak:init()
|
||||
self.enabled = not self.enabled
|
||||
self:updateCssText(true) -- apply it immediately
|
||||
end,
|
||||
hold_may_update_menu = true, -- just to keep menu opened
|
||||
hold_callback = function()
|
||||
UIManager:show(InfoMessage:new{
|
||||
text = _(
|
||||
@@ -398,8 +397,7 @@ You can enable individual tweaks on this book with a tap, or view more details a
|
||||
end
|
||||
return title
|
||||
end,
|
||||
hold_may_update_menu = true,
|
||||
hold_callback = function(refresh_menu_func)
|
||||
hold_callback = function(touchmenu_instance)
|
||||
UIManager:show(TweakInfoWidget:new{
|
||||
tweak = item,
|
||||
is_global_default = self.global_tweaks[item.id],
|
||||
@@ -409,7 +407,7 @@ You can enable individual tweaks on this book with a tap, or view more details a
|
||||
else
|
||||
self.global_tweaks[item.id] = true
|
||||
end
|
||||
refresh_menu_func()
|
||||
touchmenu_instance:updateItems()
|
||||
self:updateCssText(true) -- apply it immediately
|
||||
end
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user