mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
TextViewer: Allow tweaking the region of the refresh done on close.
Use it in ReaderBookmarks to clear flash_ui highlights. Fix #7230
This commit is contained in:
@@ -350,7 +350,12 @@ function ReaderBookmark:onShowBookmark()
|
||||
end,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
-- Request a full-screen refresh on close, to clear potential flash_ui highlights
|
||||
close_callback = function()
|
||||
-- TextViewer does a "partial" on CloseWidget
|
||||
UIManager:setDirty(nil, "partial")
|
||||
end,
|
||||
}
|
||||
UIManager:show(self.textviewer)
|
||||
return true
|
||||
|
||||
@@ -58,6 +58,9 @@ local TextViewer = InputContainer:new{
|
||||
text_padding = Size.padding.large,
|
||||
text_margin = Size.margin.small,
|
||||
button_padding = Size.padding.default,
|
||||
|
||||
-- Optional callback called on CloseWidget, set by the widget which showed us (e.g., to request a full-screen refresh)
|
||||
close_callback = nil,
|
||||
}
|
||||
|
||||
function TextViewer:init()
|
||||
@@ -228,6 +231,9 @@ function TextViewer:onCloseWidget()
|
||||
UIManager:setDirty(nil, function()
|
||||
return "partial", self.frame.dimen
|
||||
end)
|
||||
if self.close_callback then
|
||||
self.close_callback()
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user