Changed order of apply/cancel in settings view.
Escape now exits settings directly.
This commit is contained in:
parent
6eed028d82
commit
03685f9a33
@ -280,6 +280,7 @@ func (s *changeSettings) Enter(ctx *Context) error {
|
|||||||
)
|
)
|
||||||
buttons := &alui.StackPanel{Orientation: alui.OrientationHorizontal}
|
buttons := &alui.StackPanel{Orientation: alui.OrientationHorizontal}
|
||||||
buttons.AddChild(
|
buttons.AddChild(
|
||||||
|
newWideButton("Cancel", func() { s.ctx.Navigation.ShowMainMenu() }),
|
||||||
newWideButton("Apply", func() {
|
newWideButton("Apply", func() {
|
||||||
var controls = controls{MoveLeft: keyLeft.Key, MoveUp: keyUp.Key, MoveRight: keyRight.Key, MoveDown: keyDown.Key}
|
var controls = controls{MoveLeft: keyLeft.Key, MoveUp: keyUp.Key, MoveRight: keyRight.Key, MoveDown: keyDown.Key}
|
||||||
var video = video{Windowed: windowed.Selected, DisplayMode: displayMode.Mode()}
|
var video = video{Windowed: windowed.Selected, DisplayMode: displayMode.Mode()}
|
||||||
@ -293,11 +294,22 @@ func (s *changeSettings) Enter(ctx *Context) error {
|
|||||||
|
|
||||||
s.ctx.Navigation.ShowMainMenu()
|
s.ctx.Navigation.ShowMainMenu()
|
||||||
}),
|
}),
|
||||||
newWideButton("Cancel", func() { s.ctx.Navigation.ShowMainMenu() }),
|
|
||||||
)
|
)
|
||||||
s.AddChild(alui.Center(buttons))
|
s.AddChild(alui.Center(buttons))
|
||||||
return nil
|
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() {
|
func (s *changeSettings) Leave() {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user