Skip to content

Commit bc5d767

Browse files
committed
Don't append "Disabled: " to menu tooltip if disabled reason is empty
In some cases we set a disabled reason but leave the text empty, so that we don't get an error toast when the item is invoked. In such a case it looks awkward if there is a tooltip showing "Disabled: " with no following text.
1 parent cc235c6 commit bc5d767

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/gui/controllers/helpers/confirmation_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (self *ConfirmationHelper) IsPopupPanelFocused() bool {
348348

349349
func (self *ConfirmationHelper) TooltipForMenuItem(menuItem *types.MenuItem) string {
350350
tooltip := menuItem.Tooltip
351-
if menuItem.DisabledReason != nil {
351+
if menuItem.DisabledReason != nil && menuItem.DisabledReason.Text != "" {
352352
if tooltip != "" {
353353
tooltip += "\n\n"
354354
}

0 commit comments

Comments
 (0)