aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-12-15 08:21:53 +1200
committerDevine Lu Linvega <[email protected]>2018-12-15 08:21:53 +1200
commit499d66c8d44f4cb77819eb04e7142378cf6273dd (patch)
tree65a0c44d4c362b60578c2027dda06a40e0075252
parent9e35d3231f6b22faf3893303b5243d23f520fcfd (diff)
downloadOrca-499d66c8d44f4cb77819eb04e7142378cf6273dd.tar.gz
Orca-499d66c8d44f4cb77819eb04e7142378cf6273dd.zip
Fixes #10
-rw-r--r--README.md6
-rw-r--r--desktop/sources/index.html4
-rw-r--r--desktop/sources/scripts/terminal.js6
3 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index 334a45c..c84c40a 100644
--- a/README.md
+++ b/README.md
@@ -87,6 +87,12 @@ You can follow the [guide](GUIDE.md) to get started and play your first sounds.
- `ctrl/meta+}` increase program size horizontally.
- `ctrl/meta+{` decrease program size horizontally.
+### Window
+
+- `ctrl+=` Zoom In.
+- `ctrl+-` Zoom Out.
+- `ctrl+0` Zoom Reset.
+
## Special Operators
### Midi Output
diff --git a/desktop/sources/index.html b/desktop/sources/index.html
index eddf0a6..9f33053 100644
--- a/desktop/sources/index.html
+++ b/desktop/sources/index.html
@@ -59,6 +59,10 @@
terminal.controller.add("default","Program","Incr. Row",() => { terminal.modGrid(0,1); },"}")
terminal.controller.add("default","Program","Decr. Row",() => { terminal.modGrid(0,-1); },"{")
+ terminal.controller.add("default","View","Zoom In",() => { terminal.modZoom(0.25); },"CmdOrCtrl+=")
+ terminal.controller.add("default","View","Zoom Out",() => { terminal.modZoom(-0.25); },"CmdOrCtrl+-")
+ terminal.controller.add("default","View","Zoom Reset",() => { terminal.modZoom(1,true); },"CmdOrCtrl+0")
+
terminal.controller.add("default","Keyboard","Toggle Play Mode",() => { terminal.cursor.toggleMode(2); },"/")
terminal.controller.add("default","Theme","Open Theme",() => { terminal.theme.open(); },"CmdOrCtrl+Shift+o")
diff --git a/desktop/sources/scripts/terminal.js b/desktop/sources/scripts/terminal.js
index 415285b..810708a 100644
--- a/desktop/sources/scripts/terminal.js
+++ b/desktop/sources/scripts/terminal.js
@@ -135,6 +135,12 @@ function Terminal (orca, tile = { w: 20, h: 30 }) {
this.setSize(w, h)
}
+ this.modZoom = function (mod = 0, set = false) {
+ const { webFrame } = require('electron')
+ const currentZoomFactor = webFrame.getZoomFactor()
+ webFrame.setZoomFactor(set ? mod : currentZoomFactor + mod)
+ }
+
//
this.isCursor = function (x, y) {