mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Disable irrelevant plugins on devices with no frontlight (#12766)
Closes #12764
This commit is contained in:
@@ -5,6 +5,11 @@ Plugin for automatic dimming of the frontlight after an idle period.
|
||||
--]]--
|
||||
|
||||
local Device = require("device")
|
||||
|
||||
if not Device:hasFrontlight() then
|
||||
return { disabled = true, }
|
||||
end
|
||||
|
||||
local FFIUtil = require("ffi/util")
|
||||
local SpinWidget = require("ui/widget/spinwidget")
|
||||
local UIManager = require("ui/uimanager")
|
||||
|
||||
@@ -2,5 +2,5 @@ local _ = require("gettext")
|
||||
return {
|
||||
name = "autowarmth",
|
||||
fullname = require("device"):hasNaturalLight() and _("Auto warmth and night mode") or _("Auto night mode"),
|
||||
description = _([[This plugin allows to set the frontlight warmth automagically.]]),
|
||||
description = require("device"):hasNaturalLight() and _([[This plugin allows to set the frontlight warmth and night mode automagically.]]) or _([[This plugin allows to enable night mode automagically.]]),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user