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:
@@ -63,7 +63,7 @@ CanvasContext:init(Device)
|
||||
if G_reader_settings:has("color_rendering") then
|
||||
CanvasContext:setColorRenderingEnabled(G_reader_settings:isTrue("color_rendering"))
|
||||
else
|
||||
CanvasContext:setColorRenderingEnabled(Device.screen.isColorScreen())
|
||||
CanvasContext:setColorRenderingEnabled(Device.screen:isColorScreen())
|
||||
end
|
||||
|
||||
-- option parsing:
|
||||
@@ -170,7 +170,7 @@ elseif not QuickStart:isShown() then
|
||||
last_file = QuickStart:getQuickStart()
|
||||
end
|
||||
-- night mode
|
||||
if G_reader_settings:readSetting("night_mode") then
|
||||
if G_reader_settings:isTrue("night_mode") then
|
||||
Device.screen:toggleNightMode()
|
||||
end
|
||||
|
||||
@@ -181,7 +181,7 @@ end
|
||||
-- Inform once about color rendering on newly supported devices
|
||||
-- (there are some android devices that may not have a color screen,
|
||||
-- and we are not (yet?) able to guess that fact)
|
||||
if Device.hasColorScreen() and not G_reader_settings:has("color_rendering") then
|
||||
if Device:hasColorScreen() and not G_reader_settings:has("color_rendering") then
|
||||
-- enable it to prevent further display of this message
|
||||
G_reader_settings:saveSetting("color_rendering", true)
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
|
||||
Reference in New Issue
Block a user