textviewer: fix refresh (#8576)

When TextViewer is showing up, it causes screen refresh of the rectangle from the upper left corner of the screen (0,0) till the lower right corner of the TextViewer window (the result of `combine`).
So when the TextViewer is not full-screen, left and upper parts of the screen are refreshed.
This unpleasent screen flashing can be seen, for exampe, when showing book description from the Book information page, or when calling the clipboard (long-press on the text input box).
Let's show the TextViewer in a usual way, as (almost) all other widgets do.
reviewable/pr8588/r1
hius07 2 years ago committed by GitHub
parent befc0d9c83
commit 20e9f3e80a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,6 @@ local TextViewer = InputContainer:new{
}
function TextViewer:init()
local orig_dimen = self.frame and self.frame.dimen or Geom:new{}
-- calculate window dimension
self.align = "center"
self.region = Geom:new{
@ -221,9 +220,7 @@ function TextViewer:init()
self.movable,
}
UIManager:setDirty(self, function()
local update_region = self.frame.dimen:combine(orig_dimen)
logger.dbg("update region", update_region)
return "partial", update_region
return "partial", self.frame.dimen
end)
end

Loading…
Cancel
Save