mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-28 08:04:00 +01:00
Rename allowIcons -> showIconsNoKeybindings
This commit is contained in:
@@ -13,7 +13,11 @@ import { IContextKeyService } from '../../../../platform/contextkey/common/conte
|
||||
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
||||
|
||||
export interface ISuggestWidgetStatusOptions {
|
||||
readonly allowIcons?: boolean;
|
||||
/**
|
||||
* Whether to show icons instead of text where possible and avoid
|
||||
* keybindings all together.
|
||||
*/
|
||||
readonly showIconsNoKeybindings?: boolean;
|
||||
}
|
||||
|
||||
export class SuggestWidgetStatus {
|
||||
@@ -35,7 +39,7 @@ export class SuggestWidgetStatus {
|
||||
this.element = dom.append(container, dom.$('.suggest-status-bar'));
|
||||
|
||||
const actionViewItemProvider = <IActionViewItemProvider>(action => {
|
||||
if (options?.allowIcons) {
|
||||
if (options?.showIconsNoKeybindings) {
|
||||
return action instanceof MenuItemAction ? instantiationService.createInstance(MenuEntryActionViewItem, action, undefined) : undefined;
|
||||
} else {
|
||||
return action instanceof MenuItemAction ? instantiationService.createInstance(TextOnlyMenuEntryActionViewItem, action, { useComma: false }) : undefined;
|
||||
|
||||
@@ -278,7 +278,7 @@ export class SimpleSuggestWidget<TModel extends SimpleCompletionModel<TItem>, TI
|
||||
this._register(dom.addDisposableListener(this._details.widget.domNode, 'blur', (e) => this._onDidBlurDetails.fire(e)));
|
||||
|
||||
if (_options.statusBarMenuId && _options.showStatusBarSettingId && _configurationService.getValue(_options.showStatusBarSettingId)) {
|
||||
this._status = this._register(_instantiationService.createInstance(SuggestWidgetStatus, this.element.domNode, _options.statusBarMenuId, { allowIcons: true }));
|
||||
this._status = this._register(_instantiationService.createInstance(SuggestWidgetStatus, this.element.domNode, _options.statusBarMenuId, { showIconsNoKeybindings: true }));
|
||||
this.element.domNode.classList.toggle('with-status-bar', true);
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ export class SimpleSuggestWidget<TModel extends SimpleCompletionModel<TItem>, TI
|
||||
if (_options.statusBarMenuId && _options.showStatusBarSettingId && e.affectsConfiguration(_options.showStatusBarSettingId)) {
|
||||
const showStatusBar: boolean = _configurationService.getValue(_options.showStatusBarSettingId);
|
||||
if (showStatusBar && !this._status) {
|
||||
this._status = this._register(_instantiationService.createInstance(SuggestWidgetStatus, this.element.domNode, _options.statusBarMenuId, { allowIcons: true }));
|
||||
this._status = this._register(_instantiationService.createInstance(SuggestWidgetStatus, this.element.domNode, _options.statusBarMenuId, { showIconsNoKeybindings: true }));
|
||||
this._status.show();
|
||||
} else if (showStatusBar && this._status) {
|
||||
this._status.show();
|
||||
|
||||
Reference in New Issue
Block a user