fixed level select widget size

This commit is contained in:
Thomas von Dein 2024-03-16 23:11:22 +01:00
parent 927233aafb
commit db228094eb

View File

@ -82,10 +82,6 @@ func (scene *SelectScene) SetupUI() {
levels = append(levels, LevelEntry{Id: id, Name: scene.Game.Levels[id].Name}) levels = append(levels, LevelEntry{Id: id, Name: scene.Game.Levels[id].Name})
} }
// for i := 0; i < 40; i++ {
// levels = append(levels, LevelEntry{Id: i, Name: "level"})
// }
slog.Debug("levels", "levels", levels) slog.Debug("levels", "levels", levels)
buttonImage, err := gameui.LoadButtonImage() buttonImage, err := gameui.LoadButtonImage()
if err != nil { if err != nil {
@ -96,10 +92,10 @@ func (scene *SelectScene) SetupUI() {
// Set how wide the list should be // Set how wide the list should be
widget.ListOpts.ContainerOpts(widget.ContainerOpts.WidgetOpts( widget.ListOpts.ContainerOpts(widget.ContainerOpts.WidgetOpts(
widget.WidgetOpts.MinSize(150, 0), widget.WidgetOpts.MinSize(150, 0),
widget.WidgetOpts.LayoutData(widget.AnchorLayoutData{ widget.WidgetOpts.LayoutData(widget.RowLayoutData{
HorizontalPosition: widget.AnchorLayoutPositionCenter, Position: widget.RowLayoutPositionCenter,
VerticalPosition: widget.AnchorLayoutPositionEnd, Stretch: true,
StretchVertical: true, MaxHeight: 300,
}), }),
)), )),
// Set the entries in the list // Set the entries in the list