mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[UX] Gesture manager: add action - show dictionary/Wikipedia (#4699)
References #4687.
This commit is contained in:
@@ -39,6 +39,9 @@ local action_strings = {
|
||||
open_previous_document = _("Open previous document"),
|
||||
filemanager = _("File browser"),
|
||||
|
||||
dictionary_lookup = _("Dictionary lookup"),
|
||||
wikipedia_lookup = _("Wikipedia lookup"),
|
||||
|
||||
full_refresh = _("Full screen refresh"),
|
||||
night_mode = _("Night mode"),
|
||||
suspend = _("Suspend"),
|
||||
@@ -271,6 +274,9 @@ function ReaderGesture:buildMenu(ges, default)
|
||||
{"open_previous_document", true, true},
|
||||
{"filemanager", not self.is_docless, true},
|
||||
|
||||
{"dictionary_lookup", true},
|
||||
{"wikipedia_lookup", true, true},
|
||||
|
||||
{"full_refresh", true},
|
||||
{"night_mode", true},
|
||||
{"suspend", true},
|
||||
@@ -548,6 +554,10 @@ function ReaderGesture:gestureAction(action)
|
||||
elseif self.ui.switchDocument and self.ui.menu then
|
||||
self.ui:switchDocument(self.ui.menu:getPreviousFile())
|
||||
end
|
||||
elseif action == "dictionary_lookup" then
|
||||
self.ui:handleEvent(Event:new("ShowDictionaryLookup"))
|
||||
elseif action == "wikipedia_lookup" then
|
||||
self.ui:handleEvent(Event:new("ShowWikipediaLookup"))
|
||||
elseif action == "show_menu" then
|
||||
if self.ges_mode == "gesture_fm" then
|
||||
self.ui:handleEvent(Event:new("ShowMenu"))
|
||||
|
||||
Reference in New Issue
Block a user