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

reviewable/pr6225/r1
poire-z 4 years ago committed by GitHub
parent 95567d8af8
commit b4113769e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save