Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] Gesture manager: corner gestures #4878

Merged
merged 20 commits into from Apr 7, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

add hold on corner and hopefully address @poire-z comments regarding …

…overrides
  • Loading branch information...
Frenzie committed Apr 6, 2019
commit dd986e69e4d913abf092c0e14ea15518d1b40a08
@@ -149,6 +149,10 @@ function ReaderGesture:init()
tap_top_right_corner = self.ges_mode == "gesture_reader" and "toggle_bookmark" or "show_plus_menu",
tap_right_bottom_corner = "nothing",
tap_left_bottom_corner = Device:hasFrontlight() and "toggle_frontlight" or "nothing",
hold_top_left_corner = "nothing",
hold_top_right_corner = "nothing",
hold_bottom_left_corner = "nothing",
hold_bottom_right_corner = "nothing",
short_diagonal_swipe = "full_refresh",
multiswipe = "nothing", -- otherwise registerGesture() won't pick up on multiswipes
multiswipe_west_east = self.ges_mode == "gesture_reader" and "previous_location" or "nothing",
@@ -307,6 +311,24 @@ function ReaderGesture:addToMainMenu(menu_items)
sub_item_table = self:buildMenu("tap_right_bottom_corner", self.default_gesture["tap_right_bottom_corner"]),
separator = true,
},
{
text = _("Hold top left corner"),
enabled_func = function() return self.ges_mode == "gesture_reader" end,
sub_item_table = self:buildMenu("hold_top_left_corner", self.default_gesture["hold_top_left_corner"]),
},
{
text = _("Hold top right corner"),
sub_item_table = self:buildMenu("hold_top_right_corner", self.default_gesture["hold_top_right_corner"]),
},
{
text = _("Hold bottom left corner"),
sub_item_table = self:buildMenu("hold_bottom_left_corner", self.default_gesture["hold_bottom_left_corner"]),
},
{
text = _("Hold bottom right corner"),
sub_item_table = self:buildMenu("hold_bottom_right_corner", self.default_gesture["hold_bottom_right_corner"]),
separator = true,
},
{
text = _("Short diagonal swipe"),
sub_item_table = self:buildMenu("short_diagonal_swipe", self.default_gesture["short_diagonal_swipe"]),
@@ -607,6 +629,24 @@ function ReaderGesture:setupGesture(ges, action)
ratio_h = DTAP_ZONE_BOTTOM_RIGHT.h,
}

local overrides_tap_corner
local overrides_hold_corner
if self.is_docless then
overrides_tap_corner = {
"filemanager_tap",
}
else
overrides_tap_corner = {
"tap_backward",
"tap_forward",
"readermenu_tap",
"readerfooter_tap",
}
overrides_hold_corner = {
"readerfooter_hold",
}
end

if ges == "multiswipe" then
ges_type = "multiswipe"
zone = zone_fullscreen
@@ -619,45 +659,35 @@ function ReaderGesture:setupGesture(ges, action)
elseif ges == "tap_top_left_corner" then
ges_type = "tap"
zone = zone_top_left_corner
if not self.is_docless then
overrides = {
"tap_backward",
"tap_forward",
}
end
overrides = overrides_tap_corner
elseif ges == "tap_top_right_corner" then
ges_type = "tap"
zone = zone_top_right_corner
if not self.is_docless then
overrides = {
"tap_backward",
"tap_forward",
}
end
overrides = overrides_tap_corner
elseif ges == "tap_right_bottom_corner" then
ges_type = "tap"
zone = zone_bottom_right_corner
if self.is_docless then
overrides = {
"filemanager_tap",
}
else
overrides = {
"readerfooter_tap",
}
end
overrides = overrides_tap_corner
elseif ges == "tap_left_bottom_corner" then
ges_type = "tap"
zone = zone_bottom_left_corner
if self.is_docless then
overrides = {
"filemanager_tap",
}
else
overrides = {
"readerfooter_tap",
}
end
overrides = overrides_tap_corner
elseif ges == "hold_top_left_corner" then
ges_type = "hold"
zone = zone_top_left_corner
overrides = overrides_hold_corner
elseif ges == "hold_top_right_corner" then
ges_type = "hold"
zone = zone_top_right_corner
overrides = overrides_hold_corner
elseif ges == "hold_bottom_right_corner" then
ges_type = "hold"
zone = zone_bottom_right_corner
overrides = overrides_hold_corner
elseif ges == "hold_bottom_left_corner" then
ges_type = "hold"
zone = zone_bottom_left_corner
overrides = overrides_hold_corner
elseif ges == "two_finger_swipe_west" then
ges_type = "two_finger_swipe"
zone = zone_fullscreen
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.