summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-05-26 19:26:27 +0200
committerStefan Haller <stefan@haller-berlin.de>2024-05-26 19:26:27 +0200
commit2d0c96466afc5e299678eb0c5889e512366fab9c (patch)
tree3d088067d83c48a286f2514ee7fabb293f08b297 /pkg
parentf6ace8380f097008449891a935a8a5740651c728 (diff)
Fix calculation of tooltip height
For tooltips that are just one or two characters longer than the available width, the last word would be cut off. On my screen this happened for the tooltip for the fixup command.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/controllers/helpers/confirmation_helper.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/gui/controllers/helpers/confirmation_helper.go b/pkg/gui/controllers/helpers/confirmation_helper.go
index b5a337fbb..1e60b5f08 100644
--- a/pkg/gui/controllers/helpers/confirmation_helper.go
+++ b/pkg/gui/controllers/helpers/confirmation_helper.go
@@ -368,7 +368,8 @@ func (self *ConfirmationHelper) resizeMenu() {
if selectedItem != nil {
tooltip = self.TooltipForMenuItem(selectedItem)
}
- tooltipHeight := getMessageHeight(true, tooltip, panelWidth) + 2 // plus 2 for the frame
+ contentWidth := panelWidth - 2 // minus 2 for the frame
+ tooltipHeight := getMessageHeight(true, tooltip, contentWidth) + 2 // plus 2 for the frame
_, _ = self.c.GocuiGui().SetView(self.c.Views().Tooltip.Name(), x0, tooltipTop, x1, tooltipTop+tooltipHeight-1, 0)
}