BookStatusWidget: use correct read percentage (#8318)

Closes #8317.
pull/8320/head
hius07 3 years ago committed by GitHub
parent 23be2f278c
commit b2a7d0d5ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -236,7 +236,7 @@ function ReaderStatus:onShowBookStatus(before_show_callback)
props = self.document:getProps(), props = self.document:getProps(),
document = self.document, document = self.document,
settings = self.settings, settings = self.settings,
view = self.view, ui = self.ui,
} }
if before_show_callback then if before_show_callback then
before_show_callback() before_show_callback()

@ -78,7 +78,7 @@ function BookStatusWidget:init()
self.summary = new_summary self.summary = new_summary
end end
end end
self.total_pages = self.view.document:getPageCount() self.total_pages = self.ui.document:getPageCount()
stats_book = self:getStats() stats_book = self:getStats()
self.small_font_face = Font:getFace("smallffont") self.small_font_face = Font:getFace("smallffont")
@ -327,7 +327,7 @@ function BookStatusWidget:genBookInfoGroup()
} }
) )
-- progress bar -- progress bar
local read_percentage = self.view.state.page / self.total_pages local read_percentage = self.ui:getCurrentPage() / self.total_pages
local progress_bar = ProgressWidget:new{ local progress_bar = ProgressWidget:new{
width = math.floor(width * 0.7), width = math.floor(width * 0.7),
height = Screen:scaleBySize(10), height = Screen:scaleBySize(10),

Loading…
Cancel
Save