mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
JS-5833: fix
This commit is contained in:
parent
28ec901984
commit
422068c23d
5 changed files with 16 additions and 11 deletions
|
@ -95,7 +95,7 @@ class Api {
|
|||
};
|
||||
|
||||
setMenuBarVisibility (win, show) {
|
||||
ConfigManager.set({ hideMenuBar: !show }, () => {
|
||||
ConfigManager.set({ showMenuBar: show }, () => {
|
||||
Util.send(win, 'config', ConfigManager.config);
|
||||
|
||||
win.setMenuBarVisibility(show);
|
||||
|
|
|
@ -20,6 +20,11 @@ class ConfigManager {
|
|||
init (callBack) {
|
||||
storage.get(CONFIG_NAME, (error, data) => {
|
||||
this.config = data || {};
|
||||
|
||||
if (undefined === this.config.showMenuBar) {
|
||||
this.config.showMenuBar = true;
|
||||
};
|
||||
|
||||
this.checkChannel();
|
||||
this.checkTheme();
|
||||
|
||||
|
|
|
@ -442,9 +442,11 @@ class MenuManager {
|
|||
}
|
||||
},
|
||||
|
||||
(is.windows || is.linux) ? {
|
||||
label: Util.translate('electronMenuShowMenu'), type: 'checkbox', checked: !config.hideMenuBar, click: () => {
|
||||
Api.setMenuBarVisibility(this.win, !config.hideMenuBar);
|
||||
(is.windows || is.linux || is.macos) ? {
|
||||
label: Util.translate('electronMenuShowMenu'), type: 'checkbox', checked: config.showMenuBar, click: () => {
|
||||
const { config } = ConfigManager;
|
||||
|
||||
Api.setMenuBarVisibility(this.win, !config.showMenuBar);
|
||||
this.initTray();
|
||||
}
|
||||
} : null,
|
||||
|
|
|
@ -21,7 +21,7 @@ class WindowManager {
|
|||
list = new Set();
|
||||
|
||||
create (options, param) {
|
||||
const { hideMenuBar } = ConfigManager.config;
|
||||
const { showMenuBar } = ConfigManager.config;
|
||||
|
||||
param = Object.assign({
|
||||
backgroundColor: Util.getBgColor('dark'),
|
||||
|
@ -69,10 +69,8 @@ class WindowManager {
|
|||
Util.send(win, 'spellcheck', param.misspelledWord, param.dictionarySuggestions, param.x, param.y, param.selectionRect);
|
||||
});
|
||||
|
||||
if (hideMenuBar) {
|
||||
win.setMenuBarVisibility(false);
|
||||
win.setAutoHideMenuBar(true);
|
||||
};
|
||||
win.setMenuBarVisibility(showMenuBar);
|
||||
win.setAutoHideMenuBar(!showMenuBar);
|
||||
|
||||
return win;
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ const PageMainSettingsPersonal = observer(class PageMainSettingsPersonal extends
|
|||
render () {
|
||||
const { getId } = this.props;
|
||||
const { config, linkStyle, fullscreenObject, hideSidebar, showVault } = S.Common;
|
||||
const { hideTray, hideMenuBar } = config;
|
||||
const { hideTray, showMenuBar } = config;
|
||||
const { theme } = S.Common;
|
||||
|
||||
const themes: any[] = [
|
||||
|
@ -114,7 +114,7 @@ const PageMainSettingsPersonal = observer(class PageMainSettingsPersonal extends
|
|||
<Label text={translate('electronMenuShowMenu')} />
|
||||
<Switch
|
||||
className="big"
|
||||
value={!hideMenuBar}
|
||||
value={showMenuBar}
|
||||
onChange={(e: any, v: boolean) => {
|
||||
Renderer.send('setMenuBarVisibility', v);
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue