mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-30 11:33:36 +00:00
Compare commits
2 Commits
v5.12.2
...
update-men
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4ce25f66c | ||
|
|
c6e8d27722 |
@@ -232,7 +232,7 @@ class AppMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDarwinTpl(props) {
|
getDarwinTpl(props) {
|
||||||
const { tabs, activeTabIndex } = props;
|
const { tabs, activeTabIndex, enableMenu } = props;
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
label: `${app.getName()}`,
|
label: `${app.getName()}`,
|
||||||
@@ -247,6 +247,7 @@ class AppMenu {
|
|||||||
}, {
|
}, {
|
||||||
label: 'Keyboard Shortcuts',
|
label: 'Keyboard Shortcuts',
|
||||||
accelerator: 'Cmd+Shift+K',
|
accelerator: 'Cmd+Shift+K',
|
||||||
|
enabled: enableMenu,
|
||||||
click(item, focusedWindow) {
|
click(item, focusedWindow) {
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
AppMenu.sendAction('shortcut');
|
AppMenu.sendAction('shortcut');
|
||||||
@@ -264,6 +265,7 @@ class AppMenu {
|
|||||||
}, {
|
}, {
|
||||||
label: 'Log Out',
|
label: 'Log Out',
|
||||||
accelerator: 'Cmd+L',
|
accelerator: 'Cmd+L',
|
||||||
|
enabled: enableMenu,
|
||||||
click(item, focusedWindow) {
|
click(item, focusedWindow) {
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
AppMenu.sendAction('log-out');
|
AppMenu.sendAction('log-out');
|
||||||
@@ -325,7 +327,7 @@ class AppMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getOtherTpl(props) {
|
getOtherTpl(props) {
|
||||||
const { tabs, activeTabIndex } = props;
|
const { tabs, activeTabIndex, enableMenu } = props;
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
label: '&File',
|
label: '&File',
|
||||||
@@ -342,6 +344,7 @@ class AppMenu {
|
|||||||
}, {
|
}, {
|
||||||
label: 'Keyboard Shortcuts',
|
label: 'Keyboard Shortcuts',
|
||||||
accelerator: 'Ctrl+Shift+K',
|
accelerator: 'Ctrl+Shift+K',
|
||||||
|
enabled: enableMenu,
|
||||||
click(item, focusedWindow) {
|
click(item, focusedWindow) {
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
AppMenu.sendAction('shortcut');
|
AppMenu.sendAction('shortcut');
|
||||||
@@ -359,6 +362,7 @@ class AppMenu {
|
|||||||
}, {
|
}, {
|
||||||
label: 'Log Out',
|
label: 'Log Out',
|
||||||
accelerator: 'Ctrl+L',
|
accelerator: 'Ctrl+L',
|
||||||
|
enabled: enableMenu,
|
||||||
click(item, focusedWindow) {
|
click(item, focusedWindow) {
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
AppMenu.sendAction('log-out');
|
AppMenu.sendAction('log-out');
|
||||||
|
|||||||
@@ -308,6 +308,7 @@ class ServerManagerView {
|
|||||||
this.functionalTabs[tabProps.name] = this.tabs.length;
|
this.functionalTabs[tabProps.name] = this.tabs.length;
|
||||||
|
|
||||||
const tabIndex = this.getTabIndex();
|
const tabIndex = this.getTabIndex();
|
||||||
|
|
||||||
this.tabs.push(new FunctionalTab({
|
this.tabs.push(new FunctionalTab({
|
||||||
role: 'function',
|
role: 'function',
|
||||||
materialIcon: tabProps.materialIcon,
|
materialIcon: tabProps.materialIcon,
|
||||||
@@ -332,9 +333,11 @@ class ServerManagerView {
|
|||||||
preload: false
|
preload: false
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// To show loading indicator the first time a functional tab is opened, indicator is
|
// To show loading indicator the first time a functional tab is opened, indicator is
|
||||||
// closed when the functional tab DOM is ready, handled in webview.js
|
// closed when the functional tab DOM is ready, handled in webview.js
|
||||||
this.$webviewsContainer.classList.remove('loaded');
|
this.$webviewsContainer.classList.remove('loaded');
|
||||||
|
|
||||||
this.activateTab(this.functionalTabs[tabProps.name]);
|
this.activateTab(this.functionalTabs[tabProps.name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,7 +401,9 @@ class ServerManagerView {
|
|||||||
|
|
||||||
ipcRenderer.send('update-menu', {
|
ipcRenderer.send('update-menu', {
|
||||||
tabs: this.tabs,
|
tabs: this.tabs,
|
||||||
activeTabIndex: this.activeTabIndex
|
activeTabIndex: this.activeTabIndex,
|
||||||
|
// Following flag controls whether a menu item should be enabled or not
|
||||||
|
enableMenu: this.tabs[index].props.role === 'server'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user