Commit 41c069304b2bd78a228c769290dcaf99d6b470c2
minor refactor of zoom settings code
mix irving committed on 9/4/2017, 9:38:31 PMParent: 8fc563e4d194a9104ed67be2da2283e8539df948
Files changed
app/html/app.js | changed |
main.js | changed |
package-lock.json | changed |
app/html/app.js | ||
---|---|---|
@@ -58,29 +58,30 @@ | ||
58 | 58 … | |
59 | 59 … | addError(ev.error || ev) |
60 | 60 … | }) |
61 | 61 … | |
62 | - // TODO - extract this to keep patch-lite isolated from electron | |
62 … | + ////// TODO - extract this to keep patch-lite isolated from electron | |
63 … | + const { getCurrentWebContents, getCurrentWindow } = electron.remote | |
63 | 64 … | window.addEventListener('resize', () => { |
64 | - var wc = electron.remote.getCurrentWebContents() | |
65 … | + var wc = getCurrentWebContents() | |
65 | 66 … | wc && wc.getZoomFactor((zf) => { |
66 | 67 … | api.settings.sync.set({ |
67 | 68 … | electron: { |
68 | - zoomFactor: zf, | |
69 | - windowBounds: electron.remote.getCurrentWindow().getBounds() | |
69 … | + zoomFactor: zf, | |
70 … | + windowBounds: getCurrentWindow().getBounds() | |
70 | 71 … | } |
71 | 72 … | }) |
72 | 73 … | }) |
73 | 74 … | }) |
74 | 75 … | |
75 | 76 … | var zoomFactor = api.settings.sync.get('electron.zoomFactor') |
76 | 77 … | if (zoomFactor) |
77 | - electron.remote.getCurrentWebContents().setZoomFactor(zoomFactor) | |
78 … | + getCurrentWebContents().setZoomFactor(zoomFactor) | |
78 | 79 … | |
79 | 80 … | var bounds = api.settings.sync.get('electron.windowBounds') |
80 | 81 … | if (bounds) |
81 | - electron.remote.getCurrentWindow().setBounds(bounds) | |
82 | - /////////////////// | |
82 … | + getCurrentWindow().setBounds(bounds) | |
83 … | + ////// | |
83 | 84 … | |
84 | 85 … | return App |
85 | 86 … | } |
86 | 87 … | } |
main.js | |||
---|---|---|---|
@@ -23,10 +23,10 @@ | |||
23 | 23 … | // gatherings, | |
24 | 24 … | // bayGatherings, // TODO collect gatherings into this | |
25 | 25 … | patchbay, | |
26 | 26 … | patchContext, | |
27 | - patchcore, | ||
28 | - patchSettings | ||
27 … | + patchSettings, | ||
28 … | + patchcore | ||
29 | 29 … | ) | |
30 | 30 … | ||
31 | 31 … | const api = entry(sockets, nest('app.html.app', 'first')) | |
32 | 32 … |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 252990 bytes New file size: 253788 bytes |
Built with git-ssb-web