mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
[UX] plugins/kobolight: Handle automatic warmth
If warmth is handled automatically, do not try to change warmth but display a message instead.
This commit is contained in:
committed by
Frans de Jonge
parent
daa1f466ff
commit
ba46376299
@@ -199,10 +199,18 @@ function KoboLight:onSwipe(_, ges)
|
||||
return true
|
||||
end
|
||||
|
||||
function KoboLight:onSwipeWarmth(_, ges)
|
||||
function KoboLight:onSwipeWarmth(ignored, ges)
|
||||
local powerd = Device:getPowerDevice()
|
||||
if powerd.fl_warmth == nil then return false end
|
||||
|
||||
if powerd.auto_warmth then
|
||||
UIManager:show(Notification:new{
|
||||
text = _("Warmth is handled automatically."),
|
||||
timeout = 1.0,
|
||||
})
|
||||
return true
|
||||
end
|
||||
|
||||
local step = math.ceil(#self.steps * ges.distance / self.gestureScale)
|
||||
local delta_int = self.steps[step] or self.steps[#self.steps]
|
||||
local warmth
|
||||
|
||||
Reference in New Issue
Block a user