Fix: Status bar hides text with minimal bottom margin (#5135)

With very narrow bottom margin text is sometimes hidden by status bar.
pull/5145/head
Robert 5 years ago committed by Frans de Jonge
parent cbba7566b7
commit 69ee8c48cc

@ -295,7 +295,11 @@ function ReaderFooter:resetLayout()
end
function ReaderFooter:getHeight()
return self.footer_content:getSize().h
if self.footer_content then
return self.footer_content:getSize().h
else
return 0
end
end
function ReaderFooter:disableFooter()

@ -506,7 +506,7 @@ function ReaderTypeset:onSetPageMargins(margins, refresh_callback)
if self.view.footer.has_no_mode or self.view.footer.reclaim_height then
bottom = Screen:scaleBySize(margins[4])
else
bottom = Screen:scaleBySize(margins[4] + DMINIBAR_HEIGHT)
bottom = Screen:scaleBySize(margins[4]) + self.view.footer:getHeight()
end
self.ui.document:setPageMargins(left, top, right, bottom)
self.ui:handleEvent(Event:new("UpdatePos"))

@ -296,8 +296,8 @@ describe("Readerfooter module", function()
assert.are.same(365, footer.text_width)
footer:onPageUpdate(100)
assert.are.same(191, footer.progress_bar.width)
assert.are.same(389, footer.text_width)
assert.are.same(183, footer.progress_bar.width)
assert.are.same(397, footer.text_width)
end)
it("should support chapter markers", function()

@ -186,13 +186,13 @@ describe("Readerrolling module", function()
it("should show pages for different word gap", function()
readerui.document:setSpaceCondensing(100)
readerui:handleEvent(Event:new("ChangeScreenMode", "portrait"))
assert.are.same(248, readerui.document:getPageCount())
assert.are.same(251, readerui.document:getPageCount())
readerui.document:setSpaceCondensing(75)
readerui:handleEvent(Event:new("ChangeScreenMode", "portrait"))
assert.are.same(241, readerui.document:getPageCount())
assert.are.same(242, readerui.document:getPageCount())
readerui.document:setSpaceCondensing(50)
readerui:handleEvent(Event:new("ChangeScreenMode", "portrait"))
assert.are.same(231, readerui.document:getPageCount())
assert.are.same(233, readerui.document:getPageCount())
end)
end)

Loading…
Cancel
Save