Fix a few edge cases crashes and issues (#4334)

- ReaderConfig does not need to call again self:initGesListener() on
  screen rotation/resize, as it uses the TouchZone infrastructure
  that deals itself with rotation. So, it was adding new gestures
  that were overriding tap on footer and preventing it from working.
- ReaderFooter: fix refresh area (which was too small when toggling
  from hidden to visible)
- ReaderToc: fix crash when showing TOC in scroll mode after rotation
- Menu: fix crash when no onReturn defined (could happen when tap on
  bottom left corner when showing an empty TOC)
pull/4339/head
poire-z 6 years ago committed by GitHub
parent f92136e3c9
commit f8199dd493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -93,9 +93,6 @@ function ReaderConfig:onSwipeShowConfigMenu(ges)
end
function ReaderConfig:onSetDimensions(dimen)
if Device:isTouchDevice() then
self:initGesListener()
end
-- since we cannot redraw config_dialog with new size, we close
-- the old one on screen size change
if self.config_dialog then

@ -579,7 +579,9 @@ function ReaderFooter:_updateFooterText()
end
self.text_container.dimen.w = self.text_width
self.horizontal_group:resetLayout()
UIManager:setDirty(self.view.dialog, "ui", self.footer_content.dimen)
UIManager:setDirty(self.view.dialog, function()
return "ui", self.footer_content.dimen
end)
end
function ReaderFooter:onPageUpdate(pageno)

@ -85,7 +85,9 @@ function ReaderToc:onPageUpdate(pageno)
end
function ReaderToc:onPosUpdate(pos, pageno)
self.pageno = pageno
if pageno then
self.pageno = pageno
end
end
function ReaderToc:fillToc()

@ -695,7 +695,9 @@ function Menu:init()
-- return button
self.page_return_arrow = Button:new{
icon = "resources/icons/appbar.arrow.left.up.png",
callback = function() self:onReturn() end,
callback = function()
if self.onReturn then self:onReturn() end
end,
bordersize = 0,
show_parent = self,
readonly = self.return_arrow_propagation,

Loading…
Cancel
Save