1
0
Fork 0
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:
Andrew Simachev 2025-02-18 16:09:50 +01:00
parent 28ec901984
commit 422068c23d
No known key found for this signature in database
GPG key ID: 1DFE44B21443F0EF
5 changed files with 16 additions and 11 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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,

View file

@ -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;
};

View file

@ -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);
}}