diff options
author | SteVen Batten <6561887+sbatten@users.noreply.github.com> | 2022-07-28 22:45:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 22:45:48 +0300 |
commit | 0e2e0e2833b55469a585ccd4854748c5c7860971 (patch) | |
tree | f181e822f81095b925c9b6d81dabff5553521580 | |
parent | 0a65bea3573d503c3078eff3e4b7f26f138e967d (diff) |
add tooltip tech to dropdown buttons (#156621)
fixes #153429
-rw-r--r-- | src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts b/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts index 0af76e3b6a0..00b21774ea0 100644 --- a/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts +++ b/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts @@ -126,9 +126,22 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem { }; } + this.updateTooltip(); this.updateEnabled(); } + override getTooltip(): string | undefined { + let title: string | null = null; + + if (this.getAction().tooltip) { + title = this.getAction().tooltip; + } else if (this.getAction().label) { + title = this.getAction().label; + } + + return title ?? undefined; + } + override setActionContext(newContext: unknown): void { super.setActionContext(newContext); |