mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Allow separators to have tooltips & descriptions (#208224)
This allows the full-length separators to have tooltips and descriptions. (They had support for tooltips already, but my refactoring to a tree broke that) so really this just adds descriptions and fixes tooltips. Because of this, we now adopt the description in favor of the tooltip for QuickSearch
This commit is contained in:
parent
abb6332a8c
commit
cb9524cf4b
|
@ -110,6 +110,8 @@ class BaseQuickPickItemElement implements IQuickPickElement {
|
|||
saneAriaLabel
|
||||
};
|
||||
});
|
||||
this._saneDescription = mainItem.description;
|
||||
this._saneTooltip = mainItem.tooltip;
|
||||
}
|
||||
|
||||
// #region Lazy Getters
|
||||
|
@ -144,7 +146,7 @@ class BaseQuickPickItemElement implements IQuickPickElement {
|
|||
this._hidden = value;
|
||||
}
|
||||
|
||||
protected _saneDescription?: string;
|
||||
private _saneDescription?: string;
|
||||
get saneDescription() {
|
||||
return this._saneDescription;
|
||||
}
|
||||
|
@ -160,7 +162,7 @@ class BaseQuickPickItemElement implements IQuickPickElement {
|
|||
this._saneDetail = value;
|
||||
}
|
||||
|
||||
protected _saneTooltip?: string | IMarkdownString | HTMLElement;
|
||||
private _saneTooltip?: string | IMarkdownString | HTMLElement;
|
||||
get saneTooltip() {
|
||||
return this._saneTooltip;
|
||||
}
|
||||
|
@ -210,9 +212,7 @@ class QuickPickItemElement extends BaseQuickPickItemElement {
|
|||
? Event.map(Event.filter<{ element: IQuickPickElement; checked: boolean }>(this._onChecked.event, e => e.element === this), e => e.checked)
|
||||
: Event.None;
|
||||
|
||||
this._saneDescription = item.description;
|
||||
this._saneDetail = item.detail;
|
||||
this._saneTooltip = this.item.tooltip;
|
||||
this._labelHighlights = item.highlights?.label;
|
||||
this._descriptionHighlights = item.highlights?.description;
|
||||
this._detailHighlights = item.highlights?.detail;
|
||||
|
|
|
@ -57,6 +57,7 @@ export interface IQuickPickSeparator {
|
|||
type: 'separator';
|
||||
id?: string;
|
||||
label?: string;
|
||||
description?: string;
|
||||
ariaLabel?: string;
|
||||
buttons?: readonly IQuickInputButton[];
|
||||
tooltip?: string | IMarkdownString;
|
||||
|
|
|
@ -254,7 +254,7 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider<ITextSearch
|
|||
picks.push({
|
||||
label,
|
||||
type: 'separator',
|
||||
tooltip: description,
|
||||
description,
|
||||
buttons: [{
|
||||
iconClass: ThemeIcon.asClassName(searchOpenInFileIcon),
|
||||
tooltip: localize('QuickSearchOpenInFile', "Open File")
|
||||
|
|
Loading…
Reference in a new issue