diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-05-08 13:14:24 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-05-08 13:24:36 +1000 |
commit | 22d98249fe2256d7c11b77ad926ba8bb8b67be04 (patch) | |
tree | 3aaf91fcecb99742af1aaec54fa6dbf8419bcc64 /pkg/gui/menu_panel.go | |
parent | f257740ea7ec52f14da2207b3a261363971cfcbb (diff) |
better popup resizing logic
Diffstat (limited to 'pkg/gui/menu_panel.go')
-rw-r--r-- | pkg/gui/menu_panel.go | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/pkg/gui/menu_panel.go b/pkg/gui/menu_panel.go index dcc9831e1..459fd60ce 100644 --- a/pkg/gui/menu_panel.go +++ b/pkg/gui/menu_panel.go @@ -59,16 +59,3 @@ func (gui *Gui) createMenu(opts types.CreateMenuOptions) error { // TODO: ensure that if we're opened a menu from within a menu that it renders correctly return gui.c.PushContext(gui.State.Contexts.Menu) } - -func (gui *Gui) resizeMenu() { - itemCount := gui.State.Contexts.Menu.GetList().Len() - offset := 3 - panelWidth := gui.getConfirmationPanelWidth() - x0, y0, x1, y1 := gui.getConfirmationPanelDimensionsForContentHeight(panelWidth, itemCount+offset) - menuBottom := y1 - offset - _, _ = gui.g.SetView("menu", x0, y0, x1, menuBottom, 0) - - tooltipTop := menuBottom + 1 - tooltipHeight := gui.getMessageHeight(true, gui.State.Contexts.Menu.GetSelected().Tooltip, panelWidth) + 2 // plus 2 for the frame - _, _ = gui.g.SetView("tooltip", x0, tooltipTop, x1, tooltipTop+tooltipHeight-1, 0) -} |