From dad67cd8d483030ea1ee789f9086b46b56363b9a Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 20 Apr 2017 14:00:57 +0900 Subject: [PATCH] fix setting zoom factor --- main/window.ts | 8 +++++++- scripts/make-release.sh | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main/window.ts b/main/window.ts index 6aa7785..43ba122 100644 --- a/main/window.ts +++ b/main/window.ts @@ -117,6 +117,7 @@ function startNormalWindow(account: Account, config: Config): Promise { defaultWidth: 600, defaultHeight: 800, }); + const zoomFactor = config.zoom_factor || 0.9; const win = new BrowserWindow({ width: state.width, height: state.height, @@ -131,6 +132,7 @@ function startNormalWindow(account: Account, config: Config): Promise { sandbox: !!config.chromium_sandbox, preload: PRELOAD_JS, partition: partitionForAccount(account), + zoomFactor, }, }); win.once('ready-to-show', () => { @@ -149,6 +151,7 @@ function startNormalWindow(account: Account, config: Config): Promise { win.webContents.on('dom-ready', () => { applyUserCss(win, config); + win.webContents.setZoomFactor(zoomFactor); log.debug('Send config to renderer procress'); win.webContents.send('mstdn:config', config, account); }); @@ -167,10 +170,11 @@ function startMenuBar(account: Account, config: Config, bar: Menubar.MenubarApp log.debug('Setup a menubar window'); return new Promise(resolve => { const state = windowState({ - defaultWidth: 350, + defaultWidth: 320, defaultHeight: 420, }); const icon = trayIcon(config.icon_color); + const zoomFactor = config.zoom_factor || 0.9; const mb = bar || menubar({ icon, width: state.width, @@ -186,6 +190,7 @@ function startMenuBar(account: Account, config: Config, bar: Menubar.MenubarApp sandbox: !!config.chromium_sandbox, preload: PRELOAD_JS, partition: partitionForAccount(account), + zoomFactor, }, }); mb.once('after-create-window', () => { @@ -195,6 +200,7 @@ function startMenuBar(account: Account, config: Config, bar: Menubar.MenubarApp } mb.window.webContents.on('dom-ready', () => { applyUserCss(mb.window, config); + mb.window.webContents.setZoomFactor(zoomFactor); log.debug('Send config to renderer procress'); mb.window.webContents.send('mstdn:config', config, account); }); diff --git a/scripts/make-release.sh b/scripts/make-release.sh index 069c836..d9815b2 100755 --- a/scripts/make-release.sh +++ b/scripts/make-release.sh @@ -44,6 +44,8 @@ function make-dist() { open dist } +export PATH=./node_modules/.bin:$PATH + prepare-app pack-app make-dist