From 33b4a3f88cc341ddf750f10f81138676887197be Mon Sep 17 00:00:00 2001 From: Chris Green <24218546+chris-e-green@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:26:23 +1000 Subject: [PATCH] Make device panel scrollable Previous panel caused main window to resize when device panel was enabled so if the vertical resolution wasn't big enough you'd lose visibility of the toolbar and the text would be noticeably distorted. --- frontend/a2fyne/panelDevices.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/a2fyne/panelDevices.go b/frontend/a2fyne/panelDevices.go index b77e59e..ce0235d 100644 --- a/frontend/a2fyne/panelDevices.go +++ b/frontend/a2fyne/panelDevices.go @@ -14,17 +14,20 @@ type panelDevices struct { func newPanelDevices(s *state) *panelDevices { var pd panelDevices pd.s = s - pd.w = container.NewVBox() + pd.w = container.NewMax() + c := container.NewVBox() pd.joystick = newPanelJoystick() - pd.w.Add(pd.joystick.w) + c.Add(pd.joystick.w) var cards = s.a.GetCards() for i, card := range cards { if card != nil && card.GetName() != "" { - pd.w.Add(newPanelCard(i, card).w) + c.Add(newPanelCard(i, card).w) } } + pd.w.Add(container.NewVScroll(c)) + return &pd }