From f67c6f15e87d7717785c5d6f1f10c72904480898 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 19 Apr 2017 16:39:54 +0200 Subject: [PATCH] Add a way to launch with the menubar hidden & normal window I prefer to launch the application with a normal window, yet, the menubar on auto-hide, because most of the time, it's just taking up space and serves no purpose. This patch introduces a `config.menubar` setting that makes this possible. Defaults to `true` to preserve the current behaviour, and is only used when `normal_window` is also used. Signed-off-by: Gergely Nagy --- README.md | 6 ++++++ main/config.ts | 2 ++ main/window.ts | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c6670d1..21d3fdf 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,12 @@ When this value is set to `true`, application will be launched as a normal windo If menu bar behavior does not work for you, please use set this value to `true` to avoid it. Default value is `false` on macOS or Linux, `true` on Windows because window position is broken in some version of Windows. +### `menubar` + +When this value is set to `true`, the application will be launched with the +menubar visible, assuming `normal_window` is also true. When set to `false`, the +menubar will be hidden on launch. Default value is `true`. + ### `zoom_factor` Font zoom factor in application. It should be positive number. For example, `0.7` means `70%` font zooming. diff --git a/main/config.ts b/main/config.ts index 1ffcdd3..d72116c 100644 --- a/main/config.ts +++ b/main/config.ts @@ -13,6 +13,7 @@ export interface Config { hot_key: string; icon_color: string; always_on_top: boolean; + menubar: boolean; normal_window: boolean; zoom_factor: number; accounts: Account[]; @@ -27,6 +28,7 @@ function makeDefaultConfig(): Config { hot_key: 'CmdOrCtrl+Shift+S', icon_color: IsDarkMode ? 'white' : 'black', always_on_top: false, + menubar: true, normal_window: menubarBroken, zoom_factor: 0.9, accounts: [{ diff --git a/main/window.ts b/main/window.ts index 6e7d924..3e31f76 100644 --- a/main/window.ts +++ b/main/window.ts @@ -105,7 +105,7 @@ function startNormalWindow(account: Account, config: Config): Promise { icon: APP_ICON, show: false, useContentSize: true, - autoHideMenuBar: false, + autoHideMenuBar: !config.menubar, webPreferences: { nodeIntegration: false, sandbox: true,