Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen refresh between chapters #3989

Merged
merged 2 commits into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions frontend/apps/reader/modules/readertoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ end

function ReaderToc:onPageUpdate(pageno)
self.pageno = pageno
if G_reader_settings:readSetting("full_refresh_count") == -1 then
if self:isChapterEnd(pageno, 0) then
self.chapter_refresh = true
elseif self:isChapterBegin(pageno, 0) and self.chapter_refresh then
UIManager:setDirty("all", "full")
self.chapter_refresh = false
else
self.chapter_refresh = false
end
end
end

function ReaderToc:onPosUpdate(pos, pageno)
Expand Down
5 changes: 5 additions & 0 deletions frontend/ui/elements/refresh_menu_table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,10 @@ return {
callback = function() UIManager:setRefreshRate(custom_3()) end,
hold_input = custom_input("refresh_rate_3")
},
{
text = _("Every chapter"),
checked_func = function() return UIManager:getRefreshRate() == -1 end,
callback = function() UIManager:setRefreshRate(-1) end,
},
}
}