Gestures: Make the edge swipe zones configurable

As "global defaults" (i.e., "advanced settings" in the UI).

These were the only zones not available there, for some reason (probably
they were new and we try to avoid adding new defaults).

Fix #11142
reviewable/pr11163/r1
NiLuJe 5 months ago committed by Frans de Jonge
parent fbd012b928
commit 2554aee7a3

@ -69,6 +69,10 @@ DTAP_ZONE_BOTTOM_LEFT = {x = 0, y = 7/8, w = 1/8, h = 1/8},
DTAP_ZONE_BOTTOM_RIGHT = {x = 7/8, y = 7/8, w = 1/8, h = 1/8},
DDOUBLE_TAP_ZONE_NEXT_CHAPTER = {x = 1/4, y = 0, w = 3/4, h = 1},
DDOUBLE_TAP_ZONE_PREV_CHAPTER = {x = 0, y = 0, w = 1/4, h = 1},
DSWIPE_ZONE_LEFT_EDGE = { x = 0, y = 0, w = 1/8, h = 1},
DSWIPE_ZONE_RIGHT_EDGE = { x = 7/8, y = 0, w = 1/8, h = 1},
DSWIPE_ZONE_TOP_EDGE = { x = 0, y = 0, w = 1, h = 1/8},
DSWIPE_ZONE_BOTTOM_EDGE = { x = 0, y = 7/8, w = 1, h = 1/8},
-- koptreader config defaults
DKOPTREADER_CONFIG_FONT_SIZE = 1.0, -- range from 0.1 to 3.0

@ -784,21 +784,33 @@ function Gestures:setupGesture(ges)
ratio_w = 1, ratio_h = 1,
}
local dswipe_zone_left_edge = G_defaults:readSetting("DSWIPE_ZONE_LEFT_EDGE")
local zone_left_edge = {
ratio_x = 0, ratio_y = 0,
ratio_w = 1/8, ratio_h = 1,
ratio_x = dswipe_zone_left_edge.x,
ratio_y = dswipe_zone_left_edge.y,
ratio_w = dswipe_zone_left_edge.w,
ratio_h = dswipe_zone_left_edge.h,
}
local dswipe_zone_right_edge = G_defaults:readSetting("DSWIPE_ZONE_RIGHT_EDGE")
local zone_right_edge = {
ratio_x = 7/8, ratio_y = 0,
ratio_w = 1/8, ratio_h = 1,
ratio_x = dswipe_zone_right_edge.x,
ratio_y = dswipe_zone_right_edge.y,
ratio_w = dswipe_zone_right_edge.w,
ratio_h = dswipe_zone_right_edge.h,
}
local dswipe_zone_top_edge = G_defaults:readSetting("DSWIPE_ZONE_TOP_EDGE")
local zone_top_edge = {
ratio_x = 0, ratio_y = 0,
ratio_w = 1, ratio_h = 1/8,
ratio_x = dswipe_zone_top_edge.x,
ratio_y = dswipe_zone_top_edge.y,
ratio_w = dswipe_zone_top_edge.w,
ratio_h = dswipe_zone_top_edge.h,
}
local dswipe_zone_bottom_edge = G_defaults:readSetting("DSWIPE_ZONE_BOTTOM_EDGE")
local zone_bottom_edge = {
ratio_x = 0, ratio_y = 7/8,
ratio_w = 1, ratio_h = 1/8,
ratio_x = dswipe_zone_bottom_edge.x,
ratio_y = dswipe_zone_bottom_edge.y,
ratio_w = dswipe_zone_bottom_edge.w,
ratio_h = dswipe_zone_bottom_edge.h,
}
local dtap_zone_top_left = G_defaults:readSetting("DTAP_ZONE_TOP_LEFT")

Loading…
Cancel
Save