SkimToWidget: fix next/prev bookmark not updating it (#6216)

This commit is contained in:
poire-z
2020-06-01 07:13:58 +02:00
committed by GitHub
parent 95567d8af8
commit b4113769e3

View File

@@ -243,7 +243,7 @@ function SkimToWidget:init()
width = self.button_width,
show_parent = self,
callback = function()
self.ui:handleEvent(Event:new("GotoNextBookmarkFromPage"))
self:goToByEvent("GotoNextBookmarkFromPage")
end,
hold_callback = function()
local page = self.ui.bookmark:getLastBookmarkedPageFromPage(self.ui:getCurrentPage())
@@ -260,7 +260,7 @@ function SkimToWidget:init()
width = self.button_width,
show_parent = self,
callback = function()
self.ui:handleEvent(Event:new("GotoPreviousBookmarkFromPage"))
self:goToByEvent("GotoPreviousBookmarkFromPage")
end,
hold_callback = function()
local page = self.ui.bookmark:getFirstBookmarkedPageFromPage(self.ui:getCurrentPage())
@@ -409,6 +409,15 @@ function SkimToWidget:goToBookmark(page)
end
end
function SkimToWidget:goToByEvent(event_name)
if event_name then
self:addOriginToLocationStack()
self.ui:handleEvent(Event:new(event_name))
self.curr_page = self.ui:getCurrentPage()
self:update()
end
end
function SkimToWidget:onAnyKeyPressed()
UIManager:close(self)
return true