Enable Highlight action on single word selection (#6114)

Also add "Dictionary" and "Fulltext search" to available
and cycleable highlight actions.
Generalize long-press (3s) at end of selection to show
the highlight dialog popup.
This commit is contained in:
poire-z
2020-05-05 18:56:30 +02:00
committed by GitHub
parent 3f874f0d1f
commit 429f4bf1ae
2 changed files with 66 additions and 10 deletions

View File

@@ -546,6 +546,16 @@ common_settings.document = {
{
text = _("Highlight action"),
sub_item_table = {
{
text = _("Enable on single word selection"),
checked_func = function()
return G_reader_settings:isTrue("highlight_action_on_single_word")
end,
callback = function()
G_reader_settings:flipNilOrFalse("highlight_action_on_single_word", nil)
end,
separator = true,
},
{
text = _("Ask with popup dialog"),
checked_func = function()
@@ -582,6 +592,24 @@ common_settings.document = {
G_reader_settings:saveSetting("default_highlight_action", "wikipedia")
end,
},
{
text = _("Dictionary"),
checked_func = function()
return G_reader_settings:readSetting("default_highlight_action") == "dictionary"
end,
callback = function()
G_reader_settings:saveSetting("default_highlight_action", "dictionary")
end,
},
{
text = _("Fulltext search"),
checked_func = function()
return G_reader_settings:readSetting("default_highlight_action") == "search"
end,
callback = function()
G_reader_settings:saveSetting("default_highlight_action", "search")
end,
},
}
},
},