Use correct context keys for share provider title context action (#236718)
use correct context keys for share provider titile context actionpull/236721/head
parent
b8b4db329e
commit
decaa08e99
|
@ -64,15 +64,9 @@ registerAction2(class ToggleNavigationControl extends ToggleTitleBarConfigAction
|
|||
}
|
||||
});
|
||||
|
||||
registerAction2(class ToggleShareControl extends ToggleTitleBarConfigAction {
|
||||
constructor() {
|
||||
super('workbench.experimental.share.enabled', localize('toggle.share', 'Share'), localize('toggle.shareDescription', "Toggle visibility of the Share action in title bar"), 2, false, ContextKeyExpr.has('config.window.commandCenter'));
|
||||
}
|
||||
});
|
||||
|
||||
registerAction2(class ToggleLayoutControl extends ToggleTitleBarConfigAction {
|
||||
constructor() {
|
||||
super(LayoutSettings.LAYOUT_ACTIONS, localize('toggle.layout', 'Layout Controls'), localize('toggle.layoutDescription', "Toggle visibility of the Layout Controls in title bar"), 3, true);
|
||||
super(LayoutSettings.LAYOUT_ACTIONS, localize('toggle.layout', 'Layout Controls'), localize('toggle.layoutDescription', "Toggle visibility of the Layout Controls in title bar"), 4, true);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -543,7 +543,7 @@ registerAction2(class ToggleCopilotControl extends ToggleTitleBarConfigAction {
|
|||
super(
|
||||
'chat.commandCenter.enabled',
|
||||
localize('toggle.chatControl', 'Copilot Controls'),
|
||||
localize('toggle.chatControlsDescription', "Toggle visibility of the Copilot Controls in title bar"), 4, false,
|
||||
localize('toggle.chatControlsDescription', "Toggle visibility of the Copilot Controls in title bar"), 5, false,
|
||||
ContextKeyExpr.and(
|
||||
ChatContextKeys.supported,
|
||||
ContextKeyExpr.has('config.window.commandCenter')
|
||||
|
|
|
@ -9,11 +9,13 @@ import { URI } from '../../../../base/common/uri.js';
|
|||
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
|
||||
import { score } from '../../../../editor/common/languageSelector.js';
|
||||
import { localize } from '../../../../nls.js';
|
||||
import { ISubmenuItem } from '../../../../platform/actions/common/actions.js';
|
||||
import { IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
||||
import { ISubmenuItem, registerAction2 } from '../../../../platform/actions/common/actions.js';
|
||||
import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
||||
import { ILabelService } from '../../../../platform/label/common/label.js';
|
||||
import { IQuickInputService, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';
|
||||
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
|
||||
import { ToggleTitleBarConfigAction } from '../../../browser/parts/titlebar/titlebarActions.js';
|
||||
import { WorkspaceFolderCountContext } from '../../../common/contextkeys.js';
|
||||
import { IShareProvider, IShareService, IShareableItem } from '../common/share.js';
|
||||
|
||||
export const ShareProviderCountContext = new RawContextKey<number>('shareProviderCount', 0, localize('shareProviderCount', "The number of available share providers"));
|
||||
|
@ -84,3 +86,9 @@ export class ShareService implements IShareService {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
registerAction2(class ToggleShareControl extends ToggleTitleBarConfigAction {
|
||||
constructor() {
|
||||
super('workbench.experimental.share.enabled', localize('toggle.share', 'Share'), localize('toggle.shareDescription', "Toggle visibility of the Share action in title bar"), 3, false, ContextKeyExpr.and(ContextKeyExpr.has('config.window.commandCenter'), ContextKeyExpr.and(ShareProviderCountContext.notEqualsTo(0), WorkspaceFolderCountContext.notEqualsTo(0))));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue