[UX] Gesture manager: add action - fulltext search (#4715)

Fixes #4687.
pull/4716/head
Frans de Jonge 5 years ago committed by GitHub
parent c9de46d656
commit e96ac7e7dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,6 +42,7 @@ local action_strings = {
dictionary_lookup = _("Dictionary lookup"),
wikipedia_lookup = _("Wikipedia lookup"),
fulltext_search = _("Fulltext search"),
full_refresh = _("Full screen refresh"),
night_mode = _("Night mode"),
@ -282,6 +283,7 @@ function ReaderGesture:buildMenu(ges, default)
{"dictionary_lookup", true},
{"wikipedia_lookup", true, true},
{"fulltext_search", not self.is_docless, true},
{"full_refresh", true},
{"night_mode", true},
@ -567,6 +569,8 @@ function ReaderGesture:gestureAction(action, ges)
self.ui:handleEvent(Event:new("ShowDictionaryLookup"))
elseif action == "wikipedia_lookup" then
self.ui:handleEvent(Event:new("ShowWikipediaLookup"))
elseif action == "fulltext_search" then
self.ui:handleEvent(Event:new("ShowFulltextSearchInput"))
elseif action == "show_menu" then
if self.ges_mode == "gesture_fm" then
self.ui:handleEvent(Event:new("ShowMenu"))

@ -21,14 +21,20 @@ end
function ReaderSearch:addToMainMenu(menu_items)
menu_items.fulltext_search = {
text = _("Fulltext search"),
tap_input = {
title = _("Input text to search for"),
ok_text = _("Search all text"),
type = "text",
callback = function(input)
self:onShowSearchDialog(input)
end,
},
callback = function()
self:onShowFulltextSearchInput()
end,
}
end
function ReaderSearch:onShowFulltextSearchInput()
self:onInput{
title = _("Enter text to search for"),
ok_text = _("Search all text"),
type = "text",
callback = function(input)
self:onShowSearchDialog(input)
end,
}
end

Loading…
Cancel
Save