diff --git a/defaults.lua b/defaults.lua index f4563b987..8f5e93219 100644 --- a/defaults.lua +++ b/defaults.lua @@ -116,6 +116,10 @@ DAUTO_SAVE_PAGING_COUNT = nil -- dictionary font size DDICT_FONT_SIZE = 20 +-- Frontlight decrease of sensitivity for two-fingered pan gesture, +-- e.g. 2 changes the sensitivity by 1/2, 3 by 1/3 etc. +FRONTLIGHT_SENSITIVITY_DECREASE = 2 + -- #################################################################### -- following features are not supported right now -- #################################################################### diff --git a/frontend/apps/reader/modules/readerfrontlight.lua b/frontend/apps/reader/modules/readerfrontlight.lua index ae3330dff..675838967 100644 --- a/frontend/apps/reader/modules/readerfrontlight.lua +++ b/frontend/apps/reader/modules/readerfrontlight.lua @@ -11,6 +11,7 @@ local _ = require("gettext") local ReaderFrontLight = InputContainer:new{ steps = {0,1,1,1,1,2,2,2,3,4,5,6,7,8,9,10}, + gestureScale = Screen:getWidth() * FRONTLIGHT_SENSITIVITY_DECREASE, } function ReaderFrontLight:init() @@ -42,7 +43,7 @@ function ReaderFrontLight:onAdjust(arg, ges) local powerd = Device:getPowerDevice() if powerd.flIntensity ~= nil then DEBUG("frontlight intensity", powerd.flIntensity) - local step = math.ceil(#self.steps * ges.distance / Screen:getWidth()) + 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)