Make sure getting rid of a DPI override actually restores default behavior (#6984)

* Make switching *back* to the default DPI via auto actually work
properly.

eg., by actually setting DPI back to defaults, and clearing the override
flag.

* Bump base to pickup https://github.com/koreader/koreader-base/pull/1258
pull/6990/head
NiLuJe 3 years ago committed by GitHub
parent 582807f971
commit e0ac00f310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit 5d2695b520977a48066043e8e1712cced90e0d15
Subproject commit ab6cf44acb60e6db7cf4c152af523272d47b0117

@ -205,9 +205,9 @@ function Device:init()
end
function Device:setScreenDPI(dpi_override)
-- Passing a nil resets to defaults and clears the override flag
self.screen:setDPI(dpi_override)
self.input.gesture_detector:init()
self.screen_dpi_override = dpi_override
end
function Device:getPowerDevice()

@ -3,7 +3,7 @@ local Device = require("device")
local Screen = Device.screen
local T = require("ffi/util").template
local function isAutoDPI() return Device.screen_dpi_override == nil end
local function isAutoDPI() return Screen.dpi_override == nil end
local function dpi() return Screen:getDPI() end
@ -16,7 +16,9 @@ local function setDPI(_dpi)
text = _dpi and T(_("DPI set to %1. This will take effect after restarting."), _dpi)
or _("DPI set to auto. This will take effect after restarting."),
})
-- If this is set to nil, reader.lua doesn't call setScreenDPI
G_reader_settings:saveSetting("screen_dpi", _dpi)
-- Passing a nil properly resets to defaults/auto
Device:setScreenDPI(_dpi)
end

Loading…
Cancel
Save