mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Restart KOReader: add a ConfirmBox instead of a plain InfoMessage (#9853)
This commit is contained in:
@@ -10,16 +10,14 @@ local function dpi() return Screen:getDPI() end
|
||||
local function custom() return G_reader_settings:readSetting("custom_screen_dpi") end
|
||||
|
||||
local function setDPI(dpi_val)
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
local UIManager = require("ui/uimanager")
|
||||
UIManager:show(InfoMessage:new{
|
||||
text = dpi_val and T(_("DPI set to %1. This will take effect after restarting."), dpi_val)
|
||||
or _("DPI set to auto. This will take effect after restarting."),
|
||||
})
|
||||
local text = dpi_val and T(_("DPI set to %1. This will take effect after restarting."), dpi_val)
|
||||
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_val)
|
||||
-- Passing a nil properly resets to defaults/auto
|
||||
Device:setScreenDPI(dpi_val)
|
||||
UIManager:askForRestart(text)
|
||||
end
|
||||
|
||||
local function spinWidgetSetDPI(touchmenu_instance)
|
||||
|
||||
Reference in New Issue
Block a user