From 061066aa4bd4c1c105c9d2a16b539214c26bb77d Mon Sep 17 00:00:00 2001 From: Gilgamesh Athoraya Date: Thu, 7 Sep 2023 00:29:54 +0200 Subject: [PATCH 1/3] Add hide/show command for mac --- src/menu.js | 17 ++++++++++------- src/prf.js | 4 ++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/menu.js b/src/menu.js index c4c6a19a..da544dbd 100644 --- a/src/menu.js +++ b/src/menu.js @@ -25,15 +25,18 @@ D.installMenu = function Menu(mx) { x.checkBoxPref((v) => { mi.checked = !!v; }); } const roles = { - cut: 1, - copy: 1, - paste: 1, - togglefullscreen: 1, - window: 1, - help: 1, + cut: 0, + copy: 0, + paste: 0, + togglefullscreen: 0, + window: 0, + help: 0, + hide: 0, + hideothers: 0, + showall: 'unhide', }; const r = x[''].replace(/[& ]/g, '').toLowerCase(); - if (r in roles) h.role = r; + if (r in roles) h.role = roles[r] || r; if (x.items) { h.submenu = new D.el.Menu(); x.items.forEach((y) => { h.submenu.append(render(y)); }); diff --git a/src/prf.js b/src/prf.js index 29172b3c..372799dd 100644 --- a/src/prf.js +++ b/src/prf.js @@ -82,6 +82,10 @@ D.prf = {}; + '\n -' + '\n Preferences... =PRF' + '\n - ' + + '\n Hide {mac}' + + '\n Hide Others {mac}' + + '\n Show All {mac}' + + '\n - {mac}' + '\n &Quit =QIT' + '\n&File {!browser}' + '\n &Open... =OWS {local}' From 837aa0b57f7c757ada1089414f1a376cdf839d31 Mon Sep 17 00:00:00 2001 From: Gilgamesh Athoraya Date: Thu, 7 Sep 2023 00:30:32 +0200 Subject: [PATCH 2/3] Add default shortcut to preferences for mac --- src/cmds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmds.js b/src/cmds.js index ca2abb71..a0482c82 100644 --- a/src/cmds.js +++ b/src/cmds.js @@ -45,7 +45,7 @@ D.cmds = [ ['OWS','Open Workspace', [D.mac?'Cmd+O':'Ctrl+O']], ['PAT','Pause all Threads', []], ['POE','Pause on Error', []], - ['PRF','Show preferences', []], + ['PRF','Show preferences', D.mac?['Cmd+,']:[]], ['PV' ,'Previous match', []], ['QCP','Quick Command Palette', []], ['QIT','Quit', [D.mac?'Cmd+Q':'Ctrl+Q']], From 0cf05f852c3ceebff8f55da69e594f18ca4f731e Mon Sep 17 00:00:00 2001 From: Gilgamesh Athoraya Date: Thu, 7 Sep 2023 00:31:10 +0200 Subject: [PATCH 3/3] Add close window command with default shc for mac --- src/cmds.js | 1 + src/ed.js | 1 + src/km.js | 2 +- src/se.js | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmds.js b/src/cmds.js index a0482c82..fd4e2f21 100644 --- a/src/cmds.js +++ b/src/cmds.js @@ -18,6 +18,7 @@ D.cmds = [ ['CAM','Clear all trace/stop/monitor',[]], ['CAW','Close All Windows',[]], ['CBP','Clear stops for active object',[]], + ['CLS','Close window', D.mac?['Cmd+W']:[]], ['CNC','Connect', []], ['DK', 'Delete lines', []], ['DHI','Dyalog Help Index', []], diff --git a/src/ed.js b/src/ed.js index dd74f601..0195909a 100644 --- a/src/ed.js +++ b/src/ed.js @@ -593,6 +593,7 @@ D.Ed.prototype = { steps = Math.abs(steps); for (let i = 0; i < steps; i++) { D.send(cmd, { win: this.id }); } }, + CLS() { this.onClose(); }, EP(me) { this.isClosing = 1; this.FX(me); }, FX(me) { const ed = this; diff --git a/src/km.js b/src/km.js index 530a55b9..285101d2 100644 --- a/src/km.js +++ b/src/km.js @@ -348,7 +348,7 @@ (h && h[x]) ? h.execCommand(x) : $.alert(`Command ${x} not implemented.`); }); }; - ('CBP MA AC VAL indentOrComplete indentMoreOrAutocomplete STL TVO TVB' + ('CLS CBP MA AC VAL indentOrComplete indentMoreOrAutocomplete STL TVO TVB' + ' TGC JBK JSC LOG WSE').split(' ').forEach(defCmd); for (let i = 0; i < C.length; i++) { if (C[i]) { diff --git a/src/se.js b/src/se.js index 51abca1e..c25a10dd 100644 --- a/src/se.js +++ b/src/se.js @@ -753,6 +753,7 @@ D.Se.prototype = { } se.hl(); }, + CLS() {}, EP() { this.ide.focusMRUWin(); }, ER() { this.exec(0); }, TC() { this.exec(1); },