Changed order of apply/cancel in settings view.

Escape now exits settings directly.
This commit is contained in:
Sander Schobers 2019-12-29 22:06:38 +01:00
parent 6eed028d82
commit 03685f9a33

View File

@ -280,6 +280,7 @@ func (s *changeSettings) Enter(ctx *Context) error {
)
buttons := &alui.StackPanel{Orientation: alui.OrientationHorizontal}
buttons.AddChild(
newWideButton("Cancel", func() { s.ctx.Navigation.ShowMainMenu() }),
newWideButton("Apply", func() {
var controls = controls{MoveLeft: keyLeft.Key, MoveUp: keyUp.Key, MoveRight: keyRight.Key, MoveDown: keyDown.Key}
var video = video{Windowed: windowed.Selected, DisplayMode: displayMode.Mode()}
@ -293,11 +294,22 @@ func (s *changeSettings) Enter(ctx *Context) error {
s.ctx.Navigation.ShowMainMenu()
}),
newWideButton("Cancel", func() { s.ctx.Navigation.ShowMainMenu() }),
)
s.AddChild(alui.Center(buttons))
return nil
}
func (s *changeSettings) Handle(e allg5.Event) {
s.Column.Handle(e)
switch e := e.(type) {
case *allg5.KeyDownEvent:
switch e.KeyCode {
case allg5.KeyEscape:
s.ctx.Navigation.ShowMainMenu()
}
}
}
func (s *changeSettings) Leave() {
}