Skip to content

Commit 6601cf6

Browse files
webfilteredgithub-actions
andauthored
Add setting to enable Litegraph trackpad gestures (#3751)
Co-authored-by: github-actions <[email protected]>
1 parent 77ac4a4 commit 6601cf6

File tree

11 files changed

+48
-1
lines changed

11 files changed

+48
-1
lines changed

src/composables/useLitegraphSettings.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,10 @@ export const useLitegraphSettings = () => {
122122
'LiteGraph.Reroute.SplineOffset'
123123
)
124124
})
125+
126+
watchEffect(() => {
127+
LiteGraph.macTrackpadGestures = settingStore.get(
128+
'LiteGraph.Pointer.TrackpadGestures'
129+
)
130+
})
125131
}

src/constants/coreSettings.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,5 +817,16 @@ export const CORE_SETTINGS: SettingParams[] = [
817817
type: 'boolean',
818818
defaultValue: false,
819819
versionAdded: '1.18.0'
820+
},
821+
{
822+
id: 'LiteGraph.Pointer.TrackpadGestures',
823+
category: ['LiteGraph', 'Pointer', 'Trackpad Gestures'],
824+
experimental: true,
825+
name: 'Enable trackpad gestures',
826+
tooltip:
827+
'This setting enables trackpad mode for the canvas, allowing pinch-to-zoom and panning with two fingers.',
828+
type: 'boolean',
829+
defaultValue: false,
830+
versionAdded: '1.19.1'
820831
}
821832
]

src/locales/en/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
"LiteGraph_Node_TooltipDelay": {
388388
"name": "Tooltip Delay"
389389
},
390+
"LiteGraph_Pointer_TrackpadGestures": {
391+
"name": "Enable trackpad gestures",
392+
"tooltip": "This setting enables trackpad mode for the canvas, allowing pinch-to-zoom and panning with two fingers."
393+
},
390394
"LiteGraph_Reroute_SplineOffset": {
391395
"name": "Reroute spline offset",
392396
"tooltip": "The bezier control point offset from the reroute centre point"

src/locales/es/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
"LiteGraph_Node_TooltipDelay": {
388388
"name": "Retraso de la información sobre herramientas"
389389
},
390+
"LiteGraph_Pointer_TrackpadGestures": {
391+
"name": "Habilitar gestos del trackpad",
392+
"tooltip": "Esta configuración activa el modo trackpad para el lienzo, permitiendo hacer zoom con pellizco y desplazar con dos dedos."
393+
},
390394
"LiteGraph_Reroute_SplineOffset": {
391395
"name": "Desvío de la compensación de la spline",
392396
"tooltip": "El punto de control bezier desplazado desde el punto central de reenrutamiento"

src/locales/fr/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
"LiteGraph_Node_TooltipDelay": {
388388
"name": "Délai d'infobulle"
389389
},
390+
"LiteGraph_Pointer_TrackpadGestures": {
391+
"name": "Activer les gestes du trackpad",
392+
"tooltip": "Ce paramètre active le mode trackpad pour le canevas, permettant le zoom par pincement et le déplacement à deux doigts."
393+
},
390394
"LiteGraph_Reroute_SplineOffset": {
391395
"name": "Réacheminement décalage de spline",
392396
"tooltip": "Le point de contrôle de Bézier est décalé par rapport au point central de réacheminement"

src/locales/ja/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
"LiteGraph_Node_TooltipDelay": {
388388
"name": "ツールチップ遅延"
389389
},
390+
"LiteGraph_Pointer_TrackpadGestures": {
391+
"name": "トラックパッドジェスチャーを有効にする",
392+
"tooltip": "この設定を有効にすると、キャンバスでトラックパッドモードが有効になり、ピンチズームや2本指でのパン操作が可能になります。"
393+
},
390394
"LiteGraph_Reroute_SplineOffset": {
391395
"name": "リルートスプラインオフセット",
392396
"tooltip": "リルート中心点からのベジエ制御点のオフセット"

src/locales/ko/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
"LiteGraph_Node_TooltipDelay": {
388388
"name": "툴팁 지연"
389389
},
390+
"LiteGraph_Pointer_TrackpadGestures": {
391+
"name": "트랙패드 제스처 활성화",
392+
"tooltip": "이 설정을 켜면 캔버스에서 트랙패드 모드를 사용할 수 있으며, 두 손가락으로 확대/축소 및 이동이 가능합니다."
393+
},
390394
"LiteGraph_Reroute_SplineOffset": {
391395
"name": "경유점 스플라인 오프셋",
392396
"tooltip": "경유점 중심에서 베지어 제어점까지의 오프셋"

src/locales/ru/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
"LiteGraph_Node_TooltipDelay": {
388388
"name": "Задержка всплывающей подсказки"
389389
},
390+
"LiteGraph_Pointer_TrackpadGestures": {
391+
"name": "Включить жесты трекпада",
392+
"tooltip": "Эта настройка включает режим трекпада для холста, позволяя использовать масштабирование щипком и панорамирование двумя пальцами."
393+
},
390394
"LiteGraph_Reroute_SplineOffset": {
391395
"name": "Перераспределение смещения сплайна",
392396
"tooltip": "Смещение контрольной точки Безье от центральной точки перераспределения"

src/locales/zh/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
"LiteGraph_Node_TooltipDelay": {
388388
"name": "工具提示延迟"
389389
},
390+
"LiteGraph_Pointer_TrackpadGestures": {
391+
"name": "启用触控板手势",
392+
"tooltip": "此设置为画布启用触控板模式,允许使用双指捏合缩放和拖动。"
393+
},
390394
"LiteGraph_Reroute_SplineOffset": {
391395
"name": "重新路由样条偏移",
392396
"tooltip": "贝塞尔控制点从重新路由中心点的偏移"

src/schemas/apiSchema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ const zSettings = z.object({
456456
'test.setting': z.any(),
457457
'main.sub.setting.name': z.any(),
458458
'single.setting': z.any(),
459-
'LiteGraph.Node.DefaultPadding': z.boolean()
459+
'LiteGraph.Node.DefaultPadding': z.boolean(),
460+
'LiteGraph.Pointer.TrackpadGestures': z.boolean()
460461
})
461462

462463
export type EmbeddingsResponse = z.infer<typeof zEmbeddingsResponse>

0 commit comments

Comments
 (0)