blob: ee106223e88c5fe2d9c2228d93ac1471311f3391 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
package gui
func (gui *Gui) handleCreateExtrasMenuPanel() error {
menuItems := []*menuItem{
{
displayString: gui.Tr.ToggleShowCommandLog,
onPress: func() error {
currentContext := gui.currentStaticContext()
if gui.ShowExtrasWindow && currentContext.GetKey() == COMMAND_LOG_CONTEXT_KEY {
if err := gui.returnFromContext(); err != nil {
return err
}
}
show := !gui.ShowExtrasWindow
gui.ShowExtrasWindow = show
gui.Config.GetAppState().HideCommandLog = !show
_ = gui.Config.SaveAppState()
return nil
},
},
{
displayString: gui.Tr.FocusCommandLog,
onPress: gui.handleFocusCommandLog,
},
}
return gui.createMenu(gui.Tr.CommandLog, menuItems, createMenuOptions{showCancel: true})
}
func (gui *Gui) handleFocusCommandLog() error {
gui.ShowExtrasWindow = true
gui.State.Contexts.CommandLog.SetParentContext(gui.currentSideContext())
return gui.pushContext(gui.State.Contexts.CommandLog)
}
func (gui *Gui) scrollUpExtra() error {
gui.Views.Extras.Autoscroll = false
return gui.scrollUpView(gui.Views.Extras)
}
func (gui *Gui) scrollDownExtra() error {
gui.Views.Extras.Autoscroll = false
if err := gui.scrollDownView(gui.Views.Extras); err != nil {
return err
}
return nil
}
|