chore: rename frontlight related variables to keep style consistent

flIntensity -> fl_intensity
flState -> is_fl_on
fallback_FrontLightLevel -> fallback_fl_level
This commit is contained in:
Qingping Hou
2016-03-01 22:06:21 -08:00
committed by NiLuJe
parent 32874b18c5
commit 9afae91b13
6 changed files with 29 additions and 29 deletions

View File

@@ -40,17 +40,17 @@ end
function ReaderFrontLight:onAdjust(arg, ges)
local powerd = Device:getPowerDevice()
if powerd.flIntensity ~= nil then
DEBUG("frontlight intensity", powerd.flIntensity)
if powerd.fl_intensity ~= nil then
DEBUG("frontlight intensity", powerd.fl_intensity)
local step = math.ceil(#self.steps * ges.distance / self.gestureScale)
DEBUG("step = ", step)
local delta_int = self.steps[step] or self.steps[#self.steps]
DEBUG("delta_int = ", delta_int)
local new_intensity
if ges.direction == "north" then
new_intensity = powerd.flIntensity + delta_int
new_intensity = powerd.fl_intensity + delta_int
elseif ges.direction == "south" then
new_intensity = powerd.flIntensity - delta_int
new_intensity = powerd.fl_intensity - delta_int
end
if new_intensity ~= nil then
powerd:setIntensity(new_intensity)
@@ -61,9 +61,9 @@ end
function ReaderFrontLight:onShowIntensity()
local powerd = Device:getPowerDevice()
if powerd.flIntensity ~= nil then
if powerd.fl_intensity ~= nil then
UIManager:show(Notification:new{
text = T( _("Frontlight intensity is set to %1."), powerd.flIntensity),
text = T( _("Frontlight intensity is set to %1."), powerd.fl_intensity),
timeout = 1.0,
})
end