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