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:
parent
c1d25536a3
commit
33b4a3f88c
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue