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

Fix swipe direction and comment gestures that are not working well yet #3239

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/App/WebView/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ final class WebViewController: UIViewController, WKNavigationDelegate, WKUIDeleg
}

@objc private func screenEdgeGestureRecognizerAction(_ gesture: UIScreenEdgePanGestureRecognizer) {
let gesture: HAGesture = gesture.edges == .left ? .swipeLeft : .swipeRight
let gesture: HAGesture = gesture.edges == .left ? .swipeRight : .swipeLeft
let action = Current.settingsStore.gestures[gesture] ?? .none
handleGestureAction(action)
}
Expand Down
44 changes: 22 additions & 22 deletions Sources/Shared/HAGesture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public enum HAGesture: CaseIterable, Codable {
case swipeRight
case swipeLeft
case _3FingersSwipeUp
case _3FingersSwipeDown
// case _3FingersSwipeDown
case _3FingersSwipeLeft
case _3FingersSwipeRight
case _2FingersSwipeUp
case _2FingersSwipeDown
// case _2FingersSwipeUp
// case _2FingersSwipeDown
case _2FingersSwipeLeft
case _2FingersSwipeRight

Expand All @@ -53,16 +53,16 @@ public enum HAGesture: CaseIterable, Codable {
return L10n.Gestures.SwipeLeft.title
case ._3FingersSwipeUp:
return L10n.Gestures._3FingersSwipeUp.title
case ._3FingersSwipeDown:
return L10n.Gestures._3FingersSwipeDown.title
// case ._3FingersSwipeDown:
// return L10n.Gestures._3FingersSwipeDown.title
case ._3FingersSwipeLeft:
return L10n.Gestures._3FingersSwipeLeft.title
case ._3FingersSwipeRight:
return L10n.Gestures._3FingersSwipeRight.title
case ._2FingersSwipeUp:
return L10n.Gestures._2FingersSwipeUp.title
case ._2FingersSwipeDown:
return L10n.Gestures._2FingersSwipeDown.title
// case ._2FingersSwipeUp:
// return L10n.Gestures._2FingersSwipeUp.title
// case ._2FingersSwipeDown:
// return L10n.Gestures._2FingersSwipeDown.title
case ._2FingersSwipeLeft:
return L10n.Gestures._2FingersSwipeLeft.title
case ._2FingersSwipeRight:
Expand All @@ -76,18 +76,18 @@ public enum HAGesture: CaseIterable, Codable {
0
case .swipeLeft:
1
case ._2FingersSwipeUp:
2
case ._2FingersSwipeDown:
3
// case ._2FingersSwipeUp:
// 2
// case ._2FingersSwipeDown:
// 3
case ._2FingersSwipeRight:
4
case ._2FingersSwipeLeft:
5
case ._3FingersSwipeUp:
6
case ._3FingersSwipeDown:
7
// case ._3FingersSwipeDown:
// 7
case ._3FingersSwipeRight:
8
case ._3FingersSwipeLeft:
Expand All @@ -105,7 +105,7 @@ public extension [HAGesture: HAGestureAction] {
._3FingersSwipeUp: .showServersList,
._3FingersSwipeRight: .nextServer,
._3FingersSwipeLeft: .previousServer,
._3FingersSwipeDown: .showSettings,
// ._3FingersSwipeDown: .showSettings,
]
}

Expand All @@ -115,10 +115,10 @@ public extension [HAGesture: HAGestureAction] {
switch numberOfTouches {
case 1:
return .none
case 2:
return Current.settingsStore.gestures[._2FingersSwipeDown] ?? .none
case 3:
return Current.settingsStore.gestures[._3FingersSwipeDown] ?? .none
// case 2:
// return Current.settingsStore.gestures[._2FingersSwipeDown] ?? .none
// case 3:
// return Current.settingsStore.gestures[._3FingersSwipeDown] ?? .none
default:
return .none
}
Expand Down Expand Up @@ -149,8 +149,8 @@ public extension [HAGesture: HAGestureAction] {
switch numberOfTouches {
case 1:
return .none
case 2:
return Current.settingsStore.gestures[._2FingersSwipeUp] ?? .none
// case 2:
// return Current.settingsStore.gestures[._2FingersSwipeUp] ?? .none
case 3:
return Current.settingsStore.gestures[._3FingersSwipeUp] ?? .none
default:
Expand Down
4 changes: 0 additions & 4 deletions Sources/Shared/Resources/Swiftgen/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -869,10 +869,6 @@ public enum L10n {
/// 3 👆 swipe up
public static var title: String { return L10n.tr("Localizable", "gestures.3_fingers_swipe_up.title") }
}
public enum Disabled {
/// Some gestures are not configurable at the moment, in the future they may become configurable.
public static var footer: String { return L10n.tr("Localizable", "gestures.disabled.footer") }
}
public enum Footer {
/// Customize gestures to be used on the frontend.
public static var title: String { return L10n.tr("Localizable", "gestures.footer.title") }
Expand Down
Loading