Reader: Do less work on same-orientation non-gyro rotations (#11297)

Namely, don't recompute layouts, as they do not change.
(The gyro codepaths were already doing something similar.)

* Keep ConfigDialog, FileManagerMenu & ReaderMenu open on rotation.
  (In practice, only ConfigDialog is affected, as *Menu doesn't handle the rotation event.)
* Plugged an instance leak in the aforementioned Menu classes.
* Unify behavior & code with the gyro codepaths.
This commit is contained in:
zwim
2024-01-12 19:13:44 +01:00
committed by GitHub
parent ea9ef6781c
commit 2c33fc6576
6 changed files with 66 additions and 35 deletions

View File

@@ -158,11 +158,11 @@ function ReaderConfig:onSwipeShowConfigMenu(ges)
end
end
-- For some reason, things are fine and dandy without any of this for rotations, but we need it for actual resizes...
function ReaderConfig:onSetDimensions(dimen)
-- since we cannot redraw config_dialog with new size, we close
-- the old one on screen size change
if self.config_dialog then
self.config_dialog:closeDialog()
-- init basically calls update & initGesListener and nothing else, which is exactly what we want.
self.config_dialog:init()
end
end