ReaderZooming: Fix defaults handling (#7463)

It appears the fancy split settings from #6885 were not being honored at all.

Also:

* Made sure "pagewidth" is actually the default zoom mode again, "full" had sneaked in as the default state of the zoom type toggle).
* Display human-readable values in the "Make as default" popup, instead of the raw, meaningless numerical setting.
* Disable zoom options when reflow is enabled, and restore 'em properly when it's disabled.

Fix #7461, #7228, #7192
This commit is contained in:
NiLuJe
2021-03-30 18:47:52 +02:00
committed by GitHub
parent b9ffc3d05b
commit f0f69e9a7a
5 changed files with 87 additions and 23 deletions

View File

@@ -20,6 +20,8 @@ function ReaderCropping:onPageCrop(mode)
-- backup original zoom mode as cropping use "page" zoom mode
self.orig_zoom_mode = self.view.zoom_mode
if mode == "auto" then
--- @fixme: This is weird. "auto" crop happens to be the default, yet the default zoom mode/genus is "page", not "content".
--- This effectively yields different results whether auto is enabled by default, or toggled at runtime...
if self.document.configurable.text_wrap ~= 1 then
self:setCropZoomMode(true)
end
@@ -154,6 +156,10 @@ function ReaderCropping:setCropZoomMode(confirmed)
self:setZoomMode(zoom_mode_type
and "content"..zoom_mode_type
or self.orig_zoom_mode)
-- Update the configurable, too
self.document.configurable.zoom_mode_genus = zoom_mode_type
and 3 -- "content"
or 4 -- "page"
self.ui:handleEvent(Event:new("InitScrollPageStates"))
else
self:setZoomMode(self.orig_zoom_mode)