mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Update footer when refreshing screen with diagonal swipe
And added diagonal swipe support to readerrolling.
This commit is contained in:
@@ -524,6 +524,10 @@ function ReaderFooter:onPosUpdate(pos)
|
||||
self:updateFooterPos()
|
||||
end
|
||||
|
||||
function ReaderFooter:onUpdateFooter()
|
||||
self:updateFooter()
|
||||
end
|
||||
|
||||
-- recalculate footer sizes when document page count is updated
|
||||
-- see documentation for more info about this event.
|
||||
ReaderFooter.onUpdatePos = ReaderFooter.updateFooter
|
||||
|
||||
@@ -367,6 +367,8 @@ function ReaderPaging:onSwipe(_, ges)
|
||||
self:onPagingRel(-1)
|
||||
end
|
||||
else
|
||||
-- update footer (time & battery)
|
||||
self.view.footer:updateFooter()
|
||||
-- trigger full refresh
|
||||
UIManager:setDirty(nil, "full")
|
||||
end
|
||||
@@ -849,6 +851,9 @@ end
|
||||
-- wrapper for bounds checking
|
||||
function ReaderPaging:_gotoPage(number, orig_mode)
|
||||
if number == self.current_page or not number then
|
||||
-- update footer even if we stay on the same page (like when
|
||||
-- viewing the bottom part of a page from a top part view)
|
||||
self.view.footer:updateFooter()
|
||||
return true
|
||||
end
|
||||
if number > self.number_of_pages or number < 1 then
|
||||
|
||||
@@ -302,6 +302,11 @@ function ReaderRolling:onSwipe(_, ges)
|
||||
else
|
||||
self:onGotoViewRel(-1)
|
||||
end
|
||||
else
|
||||
-- update footer (time & battery)
|
||||
self.view.footer:updateFooter()
|
||||
-- trigger full refresh
|
||||
UIManager:setDirty(nil, "full")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -627,6 +627,8 @@ function DictQuickLookup:onSwipe(arg, ges)
|
||||
elseif ges.direction == "east" then
|
||||
self:changeToPrevDict()
|
||||
else
|
||||
-- update footer (time & battery)
|
||||
UIManager:broadcastEvent(Event:new("UpdateFooter"))
|
||||
-- trigger full refresh
|
||||
UIManager:setDirty(nil, "full")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user