BookStatusWidget: use correct read percentage (#8318)

Closes #8317.
This commit is contained in:
hius07
2021-10-10 12:55:32 +03:00
committed by GitHub
parent 23be2f278c
commit b2a7d0d5ce
2 changed files with 3 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ function BookStatusWidget:init()
self.summary = new_summary
end
end
self.total_pages = self.view.document:getPageCount()
self.total_pages = self.ui.document:getPageCount()
stats_book = self:getStats()
self.small_font_face = Font:getFace("smallffont")
@@ -327,7 +327,7 @@ function BookStatusWidget:genBookInfoGroup()
}
)
-- 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{
width = math.floor(width * 0.7),
height = Screen:scaleBySize(10),