mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
Add menu item allowing users to disable "hold on footer to show Skim Widget" (#6852)
This commit is contained in:
parent
090f33b5b8
commit
8a5c2e3af6
@ -428,6 +428,9 @@ function ReaderFooter:init()
|
|||||||
if not self.settings.book_chapter_max_width_pct then
|
if not self.settings.book_chapter_max_width_pct then
|
||||||
self.settings.book_chapter_max_width_pct = 30
|
self.settings.book_chapter_max_width_pct = 30
|
||||||
end
|
end
|
||||||
|
if self.settings.skim_widget_on_hold == nil then
|
||||||
|
self.settings.skim_widget_on_hold = true
|
||||||
|
end
|
||||||
self.mode_list = {}
|
self.mode_list = {}
|
||||||
for i = 0, #self.mode_index do
|
for i = 0, #self.mode_index do
|
||||||
self.mode_list[self.mode_index[i]] = i
|
self.mode_list[self.mode_index[i]] = i
|
||||||
@ -941,6 +944,16 @@ function ReaderFooter:addToMainMenu(menu_items)
|
|||||||
self.settings.lock_tap = not self.settings.lock_tap
|
self.settings.lock_tap = not self.settings.lock_tap
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text = _("Hold (footer) to skim"),
|
||||||
|
checked_func = function()
|
||||||
|
return self.settings.skim_widget_on_hold
|
||||||
|
end,
|
||||||
|
callback = function()
|
||||||
|
self.settings.skim_widget_on_hold = not self.settings.skim_widget_on_hold
|
||||||
|
G_reader_settings:saveSetting("footer", self.settings)
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text = _("Font"),
|
text = _("Font"),
|
||||||
separator = true,
|
separator = true,
|
||||||
@ -2026,8 +2039,10 @@ end
|
|||||||
|
|
||||||
function ReaderFooter:onHoldFooter()
|
function ReaderFooter:onHoldFooter()
|
||||||
if self.mode == self.mode_list.off then return end
|
if self.mode == self.mode_list.off then return end
|
||||||
self.ui:handleEvent(Event:new("ShowSkimtoDialog"))
|
if self.settings.skim_widget_on_hold then
|
||||||
return true
|
self.ui:handleEvent(Event:new("ShowSkimtoDialog"))
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ReaderFooter:setVisible(visible)
|
function ReaderFooter:setVisible(visible)
|
||||||
|
Loading…
Reference in New Issue
Block a user