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.
This commit is contained in:
Chris Green 2023-10-25 11:26:23 +10:00 committed by Iván Izaguirre
parent 4e116182e7
commit e770dbc058

View File

@ -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
}