mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
is_fl_on -> is_frontlight_on outside of powerd
Matches the reader setting we're reading/writing at that point, and avoids confusion related to scoping because it doesn't necessarily match powerd.is_fl_on at that point. Well, at least I had to wrap my mind around it ^^
This commit is contained in:
@@ -120,11 +120,12 @@ end
|
||||
if Device:isKobo() then
|
||||
local powerd = Device:getPowerDevice()
|
||||
if powerd and powerd.restore_settings then
|
||||
-- UIManager:init() should have sanely set up the frontlight_stuff by this point
|
||||
local intensity = G_reader_settings:readSetting("frontlight_intensity")
|
||||
powerd.fl_intensity = intensity or powerd.fl_intensity
|
||||
local is_fl_on = G_reader_settings:readSetting("is_frontlight_on")
|
||||
if is_fl_on then
|
||||
-- default is_fl_on is false, turn it on
|
||||
local is_frontlight_on = G_reader_settings:readSetting("is_frontlight_on")
|
||||
if is_frontlight_on then
|
||||
-- default powerd.is_fl_on is false, turn it on
|
||||
powerd:toggleFrontlight()
|
||||
else
|
||||
-- the light can still be turned on manually outside of koreader
|
||||
|
||||
Reference in New Issue
Block a user