Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(desktop): back/forward buttons and trackpad swipe navigation #27430

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/27430/headmerged by juliusmarminge View on GitHub

Showing 9 changed files with 12 additions and 1 deletion (loading 6).

x
0 of 9 viewed, 9 left
1 addition and 0 deletionsapps/desktop/src/ipc/channels.tsModified
View file
@@ -14,6 +14,7 @@
export const WEB_LINK_OPEN_CHANNEL = "desktop:web-link-open";
export const WEB_LINK_READY_CHANNEL = "desktop:web-link-ready";
export const QUIT_SHORTCUT_CHANNEL = "desktop:quit-shortcut";
+export const TRACKPAD_SCROLL_BEGIN_CHANNEL = "desktop:trackpad-scroll-begin";
export const TRACKPAD_SCROLL_END_CHANNEL = "desktop:trackpad-scroll-end";
export const GET_WINDOW_FULLSCREEN_STATE_CHANNEL = "desktop:get-window-fullscreen-state";
export const WINDOW_FULLSCREEN_STATE_CHANNEL = "desktop:window-fullscreen-state";
6 additions and 1 deletionapps/desktop/src/window/DesktopWindow.tsModified
View file
@@ -23,6 +23,7 @@
MENU_ACTION_CHANNEL,
QUIT_SHORTCUT_CHANNEL,
SNAP_SHOT_EVENT_CHANNEL,
+ TRACKPAD_SCROLL_BEGIN_CHANNEL,
TRACKPAD_SCROLL_END_CHANNEL,
WINDOW_FULLSCREEN_STATE_CHANNEL,
} from "../ipc/channels.ts";
@@ -652,7 +653,11 @@
});
window.webContents.on("input-event", (_event, input) => {
- if (input.type === "gestureScrollEnd") window.webContents.send(TRACKPAD_SCROLL_END_CHANNEL);
+ if (input.type === "gestureScrollBegin") {
+ window.webContents.send(TRACKPAD_SCROLL_BEGIN_CHANNEL);
+ } else if (input.type === "gestureScrollEnd") {
+ window.webContents.send(TRACKPAD_SCROLL_END_CHANNEL);