mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Slightly less crappy Nightmode (#4871)
Companion PR to https://github.com/koreader/koreader-base/pull/884 * Basically flags devices known to be stable when using PxP inversion. * Plus, random fix for #4870 ;). * A few FrontLight tweaks & cleanups on Kobo: * Moved the Kobo-specific startup status insanity to Kobo-specific init * Made turnOff/turnOn frontlight do a smooth ramp down/up * On Kobo, use turnOff/turnOn for suspend/resume, to get that smooth toggle * On Kobo, for NaturalLight w/ a mixer, only set warmth for setWarmth, and only set Brightness for setBrightness, otherwise, it tried to set both with not in-sync values, which made the FL widget jittery.
This commit is contained in:
@@ -38,7 +38,7 @@ function ReaderFrontLight:init()
|
||||
end
|
||||
|
||||
function ReaderFrontLight:onAdjust(arg, ges)
|
||||
if not Device.hasFrontlight() then return true end
|
||||
if not Device:hasFrontlight() then return true end
|
||||
local powerd = Device:getPowerDevice()
|
||||
logger.dbg("frontlight intensity", powerd:frontlightIntensity())
|
||||
local step = math.ceil(#self.steps * ges.distance / self.gestureScale)
|
||||
@@ -65,7 +65,7 @@ function ReaderFrontLight:onAdjust(arg, ges)
|
||||
end
|
||||
|
||||
function ReaderFrontLight:onShowIntensity()
|
||||
if not Device.hasFrontlight() then return true end
|
||||
if not Device:hasFrontlight() then return true end
|
||||
local powerd = Device:getPowerDevice()
|
||||
local new_text
|
||||
if powerd:isFrontlightOff() then
|
||||
|
||||
Reference in New Issue
Block a user