mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-24 16:43:38 +00:00
Compare commits
2 Commits
v5.9.4
...
update-men
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4ce25f66c | ||
|
|
c6e8d27722 |
@@ -232,7 +232,7 @@ class AppMenu {
|
||||
}
|
||||
|
||||
getDarwinTpl(props) {
|
||||
const { tabs, activeTabIndex } = props;
|
||||
const { tabs, activeTabIndex, enableMenu } = props;
|
||||
|
||||
return [{
|
||||
label: `${app.getName()}`,
|
||||
@@ -247,6 +247,7 @@ class AppMenu {
|
||||
}, {
|
||||
label: 'Keyboard Shortcuts',
|
||||
accelerator: 'Cmd+Shift+K',
|
||||
enabled: enableMenu,
|
||||
click(item, focusedWindow) {
|
||||
if (focusedWindow) {
|
||||
AppMenu.sendAction('shortcut');
|
||||
@@ -264,6 +265,7 @@ class AppMenu {
|
||||
}, {
|
||||
label: 'Log Out',
|
||||
accelerator: 'Cmd+L',
|
||||
enabled: enableMenu,
|
||||
click(item, focusedWindow) {
|
||||
if (focusedWindow) {
|
||||
AppMenu.sendAction('log-out');
|
||||
@@ -325,7 +327,7 @@ class AppMenu {
|
||||
}
|
||||
|
||||
getOtherTpl(props) {
|
||||
const { tabs, activeTabIndex } = props;
|
||||
const { tabs, activeTabIndex, enableMenu } = props;
|
||||
|
||||
return [{
|
||||
label: '&File',
|
||||
@@ -342,6 +344,7 @@ class AppMenu {
|
||||
}, {
|
||||
label: 'Keyboard Shortcuts',
|
||||
accelerator: 'Ctrl+Shift+K',
|
||||
enabled: enableMenu,
|
||||
click(item, focusedWindow) {
|
||||
if (focusedWindow) {
|
||||
AppMenu.sendAction('shortcut');
|
||||
@@ -359,6 +362,7 @@ class AppMenu {
|
||||
}, {
|
||||
label: 'Log Out',
|
||||
accelerator: 'Ctrl+L',
|
||||
enabled: enableMenu,
|
||||
click(item, focusedWindow) {
|
||||
if (focusedWindow) {
|
||||
AppMenu.sendAction('log-out');
|
||||
|
||||
@@ -308,6 +308,7 @@ class ServerManagerView {
|
||||
this.functionalTabs[tabProps.name] = this.tabs.length;
|
||||
|
||||
const tabIndex = this.getTabIndex();
|
||||
|
||||
this.tabs.push(new FunctionalTab({
|
||||
role: 'function',
|
||||
materialIcon: tabProps.materialIcon,
|
||||
@@ -332,9 +333,11 @@ class ServerManagerView {
|
||||
preload: false
|
||||
})
|
||||
}));
|
||||
|
||||
// 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
|
||||
this.$webviewsContainer.classList.remove('loaded');
|
||||
|
||||
this.activateTab(this.functionalTabs[tabProps.name]);
|
||||
}
|
||||
|
||||
@@ -398,7 +401,9 @@ class ServerManagerView {
|
||||
|
||||
ipcRenderer.send('update-menu', {
|
||||
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