[chore] reformat all gestures "overrides" to be diff friendly

This commit is contained in:
poire-z
2019-03-30 21:05:44 +01:00
parent 44529dbbc9
commit 7396abebf2
7 changed files with 81 additions and 22 deletions

View File

@@ -77,7 +77,10 @@ function FileManagerMenu:initGesListener()
ratio_x = DTAP_ZONE_MENU.x, ratio_y = DTAP_ZONE_MENU.y,
ratio_w = DTAP_ZONE_MENU.w, ratio_h = DTAP_ZONE_MENU.h,
},
overrides = { "rolling_swipe", "paging_swipe", },
overrides = {
"rolling_swipe",
"paging_swipe",
},
handler = function(ges) return self:onSwipeShowMenu(ges) end,
},
})

View File

@@ -44,7 +44,10 @@ function ReaderConfig:initGesListener()
ratio_x = DTAP_ZONE_CONFIG.x, ratio_y = DTAP_ZONE_CONFIG.y,
ratio_w = DTAP_ZONE_CONFIG.w, ratio_h = DTAP_ZONE_CONFIG.h,
},
overrides = { 'tap_forward', 'tap_backward', },
overrides = {
"tap_forward",
"tap_backward",
},
handler = function() return self:onTapShowConfigMenu() end,
},
{
@@ -54,7 +57,10 @@ function ReaderConfig:initGesListener()
ratio_x = DTAP_ZONE_CONFIG.x, ratio_y = DTAP_ZONE_CONFIG.y,
ratio_w = DTAP_ZONE_CONFIG.w, ratio_h = DTAP_ZONE_CONFIG.h,
},
overrides = { "rolling_swipe", "paging_swipe", },
overrides = {
"rolling_swipe",
"paging_swipe",
},
handler = function(ges) return self:onSwipeShowConfigMenu(ges) end,
},
{
@@ -64,7 +70,10 @@ function ReaderConfig:initGesListener()
ratio_x = DTAP_ZONE_CONFIG.x, ratio_y = DTAP_ZONE_CONFIG.y,
ratio_w = DTAP_ZONE_CONFIG.w, ratio_h = DTAP_ZONE_CONFIG.h,
},
overrides = { "rolling_pan", "paging_pan", },
overrides = {
"rolling_pan",
"paging_pan",
},
handler = function(ges) return self:onSwipeShowConfigMenu(ges) end,
},
})

View File

@@ -252,7 +252,9 @@ function ReaderFooter:setupTouchZones()
screen_zone = footer_screen_zone,
handler = function(ges) return self:onTapFooter(ges) end,
overrides = {
'tap_forward', 'tap_backward', 'readerconfigmenu_tap',
"tap_forward",
"tap_backward",
"readerconfigmenu_tap",
},
},
{
@@ -260,7 +262,9 @@ function ReaderFooter:setupTouchZones()
ges = "hold",
screen_zone = footer_screen_zone,
handler = function() return self:onHoldFooter() end,
overrides = {'readerhighlight_hold'},
overrides = {
"readerhighlight_hold",
},
},
})
end

View File

@@ -587,9 +587,13 @@ function ReaderGesture:setupGesture(ges, action)
ratio_w = 0.1, ratio_h = 0.1,
}
if self.is_docless then
overrides = { 'filemanager_tap' }
overrides = {
"filemanager_tap",
}
else
overrides = { 'readerfooter_tap' }
overrides = {
"readerfooter_tap",
}
end
elseif ges == "tap_left_bottom_corner" then
ges_type = "tap"
@@ -598,9 +602,13 @@ function ReaderGesture:setupGesture(ges, action)
ratio_w = 0.1, ratio_h = 0.1,
}
if self.is_docless then
overrides = { 'filemanager_tap' }
overrides = {
"filemanager_tap",
}
else
overrides = { 'readerfooter_tap' }
overrides = {
"readerfooter_tap",
}
end
elseif ges == "two_finger_swipe_west" then
ges_type = "two_finger_swipe"
@@ -635,9 +643,14 @@ function ReaderGesture:setupGesture(ges, action)
direction = {northeast = true, northwest = true, southeast = true, southwest = true}
distance = "short"
if self.is_docless then
overrides = { 'filemanager_tap' }
overrides = {
"filemanager_tap",
}
else
overrides = { 'rolling_swipe', 'paging_swipe' }
overrides = {
"rolling_swipe",
"paging_swipe",
}
end
else return

View File

@@ -35,7 +35,12 @@ function ReaderHighlight:setupTouchZones()
screen_zone = {
ratio_x = 0, ratio_y = 0, ratio_w = 1, ratio_h = 1,
},
overrides = { 'tap_forward', 'tap_backward', 'readermenu_tap', 'readerconfigmenu_tap', },
overrides = {
"tap_forward",
"tap_backward",
"readermenu_tap",
"readerconfigmenu_tap",
},
handler = function(ges) return self:onTap(nil, ges) end
},
{

View File

@@ -97,7 +97,10 @@ function ReaderMenu:onReaderReady()
ratio_x = DTAP_ZONE_MENU.x, ratio_y = DTAP_ZONE_MENU.y,
ratio_w = DTAP_ZONE_MENU.w, ratio_h = DTAP_ZONE_MENU.h,
},
overrides = { 'tap_forward', 'tap_backward', },
overrides = {
"tap_forward",
"tap_backward",
},
handler = function(ges) return self:onTapShowMenu(ges) end,
},
{
@@ -107,7 +110,10 @@ function ReaderMenu:onReaderReady()
ratio_x = DTAP_ZONE_MENU.x, ratio_y = DTAP_ZONE_MENU.y,
ratio_w = DTAP_ZONE_MENU.w, ratio_h = DTAP_ZONE_MENU.h,
},
overrides = { "rolling_swipe", "paging_swipe", },
overrides = {
"rolling_swipe",
"paging_swipe",
},
handler = function(ges) return self:onSwipeShowMenu(ges) end,
},
{
@@ -117,7 +123,10 @@ function ReaderMenu:onReaderReady()
ratio_x = DTAP_ZONE_MENU.x, ratio_y = DTAP_ZONE_MENU.y,
ratio_w = DTAP_ZONE_MENU.w, ratio_h = DTAP_ZONE_MENU.h,
},
overrides = { "rolling_pan", "paging_pan", },
overrides = {
"rolling_pan",
"paging_pan",
},
handler = function(ges) return self:onSwipeShowMenu(ges) end,
},
})

View File

@@ -64,7 +64,10 @@ function KoboLight:setupTouchZones()
ges = "swipe",
screen_zone = swipe_zone,
handler = function(ges) return self:onSwipe(nil, ges) end,
overrides = { 'paging_swipe', 'rolling_swipe', },
overrides = {
"paging_swipe",
"rolling_swipe",
},
},
{
-- dummy zone to disable reader panning
@@ -72,7 +75,10 @@ function KoboLight:setupTouchZones()
ges = "pan",
screen_zone = swipe_zone,
handler = function(ges) return true end,
overrides = { 'paging_pan', 'rolling_pan', },
overrides = {
"paging_pan",
"rolling_pan",
},
},
{
-- dummy zone to disable reader panning
@@ -80,7 +86,9 @@ function KoboLight:setupTouchZones()
ges = "pan_release",
screen_zone = swipe_zone,
handler = function(ges) return true end,
overrides = { 'paging_pan_release', },
overrides = {
"paging_pan_release",
},
},
})
if with_natural_light then
@@ -90,7 +98,10 @@ function KoboLight:setupTouchZones()
ges = "swipe",
screen_zone = swipe_zone_warmth,
handler = function(ges) return self:onSwipeWarmth(nil, ges) end,
overrides = { 'paging_swipe', 'rolling_swipe', },
overrides = {
"paging_swipe",
"rolling_swipe",
},
},
{
-- dummy zone to disable reader panning
@@ -98,7 +109,10 @@ function KoboLight:setupTouchZones()
ges = "pan",
screen_zone = swipe_zone_warmth,
handler = function(ges) return true end,
overrides = { 'paging_pan', 'rolling_pan', },
overrides = {
"paging_pan",
"rolling_pan",
},
},
{
-- dummy zone to disable reader panning
@@ -106,7 +120,9 @@ function KoboLight:setupTouchZones()
ges = "pan_release",
screen_zone = swipe_zone_warmth,
handler = function(ges) return true end,
overrides = { 'paging_pan_release', },
overrides = {
"paging_pan_release",
},
},
})
end