From be011f25f62b0b8aaf240c1e4660f9b51d44292c Mon Sep 17 00:00:00 2001 From: Jeff-Emmett Date: Tue, 25 Feb 2025 15:24:41 -0500 Subject: [PATCH] changed zoom shortcut to ctrl+up & ctrl+down, savetoPDF to alt+s --- src/ui/CustomContextMenu.tsx | 2 +- src/ui/overrides.tsx | 97 ++++-------------------------------- 2 files changed, 10 insertions(+), 89 deletions(-) diff --git a/src/ui/CustomContextMenu.tsx b/src/ui/CustomContextMenu.tsx index 4c0a303..a5a84cf 100644 --- a/src/ui/CustomContextMenu.tsx +++ b/src/ui/CustomContextMenu.tsx @@ -97,7 +97,7 @@ export function CustomContextMenu(props: TLUiContextMenuProps) { id="save-to-pdf" label="Save Selection as PDF" icon="file" - kbd="alt+p" + kbd="alt+s" disabled={!hasSelection} onSelect={() => saveToPdf(editor)} /> diff --git a/src/ui/overrides.tsx b/src/ui/overrides.tsx index 1c02522..60c7d1e 100644 --- a/src/ui/overrides.tsx +++ b/src/ui/overrides.tsx @@ -147,6 +147,14 @@ export const overrides: TLUiOverrides = { actions(editor, actions) { return { ...actions, + "zoom-in": { + ...actions["zoom-in"], + kbd: "ctrl+up", + }, + "zoom-out": { + ...actions["zoom-out"], + kbd: "ctrl+down", + }, zoomToSelection: { id: "zoom-to-selection", label: "Zoom to Selection", @@ -187,7 +195,7 @@ export const overrides: TLUiOverrides = { saveToPdf: { id: "save-to-pdf", label: "Save Selection as PDF", - kbd: "alt+p", + kbd: "alt+s", onSelect: () => { if (editor.getSelectedShapeIds().length > 0) { saveToPdf(editor) @@ -267,93 +275,6 @@ export const overrides: TLUiOverrides = { } }, }, - - // TODO: FIX THIS - resizeSelectedUp: { - id: "resize-selected-up", - label: "Resize Up", - kbd: "ctrl+ArrowUp", - onSelect: () => { - const selectedShapes = editor.getSelectedShapes() - if (selectedShapes.length > 0) { - selectedShapes.forEach((shape) => { - const bounds = editor.getShapeGeometry(shape).bounds - editor.updateShape({ - id: shape.id, - type: shape.type, - //y: shape.y - 50, - props: { - ...shape.props, - h: bounds.height + 50, - }, - }) - }) - } - }, - }, - resizeSelectedDown: { - id: "resize-selected-down", - label: "Resize Down", - kbd: "ctrl+ArrowDown", - onSelect: () => { - const selectedShapes = editor.getSelectedShapes() - if (selectedShapes.length > 0) { - selectedShapes.forEach((shape) => { - const bounds = editor.getShapeGeometry(shape).bounds - editor.updateShape({ - id: shape.id, - type: shape.type, - props: { - ...shape.props, - h: bounds.height + 50, - }, - }) - }) - } - }, - }, - resizeSelectedLeft: { - id: "resize-selected-left", - label: "Resize Left", - kbd: "ctrl+ArrowLeft", - onSelect: () => { - const selectedShapes = editor.getSelectedShapes() - if (selectedShapes.length > 0) { - selectedShapes.forEach((shape) => { - const bounds = editor.getShapeGeometry(shape).bounds - editor.updateShape({ - id: shape.id, - type: shape.type, - props: { - ...shape.props, - w: bounds.width + 50, - }, - }) - }) - } - }, - }, - resizeSelectedRight: { - id: "resize-selected-right", - label: "Resize Right", - kbd: "ctrl+ArrowRight", - onSelect: () => { - const selectedShapes = editor.getSelectedShapes() - if (selectedShapes.length > 0) { - selectedShapes.forEach((shape) => { - const bounds = editor.getShapeGeometry(shape).bounds - editor.updateShape({ - id: shape.id, - type: shape.type, - props: { - ...shape.props, - w: bounds.width + 50, - }, - }) - }) - } - }, - }, //TODO: MAKE THIS WORK, ADD USER PERMISSIONING TO JOIN BROADCAST? broadcastView: { id: "broadcast-view",