mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[UX] Gesture manager: add action - fulltext search (#4715)
Fixes #4687.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user