diff --git a/src/fontra/views/editor/editor.js b/src/fontra/views/editor/editor.js index 8078e6f7a..56503a40f 100644 --- a/src/fontra/views/editor/editor.js +++ b/src/fontra/views/editor/editor.js @@ -511,6 +511,28 @@ export class EditorController { () => this.doSelectPreviousNextSource(false) ); + registerAction( + "action.select-previous-source-layer", + { + topic, + titleKey: "menubar.view.select-previous-source-layer", + defaultShortCuts: [{ baseKey: "ArrowUp", commandKey: true, shiftKey: true }], + }, + () => this.doSelectPreviousNextSourceLayer(true) + ); + + registerAction( + "action.select-next-source-layer", + { + topic, + titleKey: "menubar.view.select-next-source-layer", + defaultShortCuts: [ + { baseKey: "ArrowDown", commandKey: true, shiftKey: true }, + ], + }, + () => this.doSelectPreviousNextSourceLayer(false) + ); + registerAction( "action.select-previous-glyph", { @@ -1586,17 +1608,17 @@ export class EditorController { this.glyphSelectedContextMenuItems = []; this.glyphSelectedContextMenuItems.push({ - actionIdentifier: "action.select-previous-source", - }); - this.glyphSelectedContextMenuItems.push({ - actionIdentifier: "action.select-next-source", - }); - this.glyphSelectedContextMenuItems.push({ - actionIdentifier: "action.select-previous-glyph", - }); - this.glyphSelectedContextMenuItems.push({ - actionIdentifier: "action.select-next-glyph", + title: "Select glyph/source/layer", + getItems: () => [ + { actionIdentifier: "action.select-previous-glyph" }, + { actionIdentifier: "action.select-next-glyph" }, + { actionIdentifier: "action.select-previous-source" }, + { actionIdentifier: "action.select-next-source" }, + { actionIdentifier: "action.select-previous-source-layer" }, + { actionIdentifier: "action.select-next-source-layer" }, + ], }); + this.glyphSelectedContextMenuItems.push({ title: () => translate( @@ -3079,6 +3101,10 @@ export class EditorController { this.sceneSettings.selectedSourceIndex = newSourceIndex; } + async doSelectPreviousNextSourceLayer(selectPrevious) { + console.log("next source layer", selectPrevious); + } + async doSelectPreviousNextGlyph(selectPrevious) { const panel = this.getSidebarPanel("glyph-search"); const glyphNames = panel.glyphsSearch.getFilteredGlyphNames();