From b4113769e314351a1fdb5eaa217c7772d408ebb9 Mon Sep 17 00:00:00 2001 From: poire-z Date: Mon, 1 Jun 2020 07:13:58 +0200 Subject: [PATCH] SkimToWidget: fix next/prev bookmark not updating it (#6216) --- frontend/apps/reader/skimtowidget.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/apps/reader/skimtowidget.lua b/frontend/apps/reader/skimtowidget.lua index 78a0d225f..f69270987 100644 --- a/frontend/apps/reader/skimtowidget.lua +++ b/frontend/apps/reader/skimtowidget.lua @@ -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