add configurable tree pane width and message logging
This commit is contained in:
6
ui.go
6
ui.go
@@ -33,6 +33,7 @@ func (b *Barnard) UpdateInputStatus(status string) {
|
||||
func (b *Barnard) AddOutputLine(line string) {
|
||||
now := time.Now()
|
||||
b.UiOutput.AddLine(fmt.Sprintf("[%02d:%02d:%02d] %s", now.Hour(), now.Minute(), now.Second(), line))
|
||||
b.logMessage(line)
|
||||
}
|
||||
|
||||
func (b *Barnard) AddOutputMessage(sender *gumble.User, message string) {
|
||||
@@ -161,11 +162,12 @@ func (b *Barnard) OnUiInitialize(ui *uiterm.Ui) {
|
||||
}
|
||||
|
||||
func (b *Barnard) OnUiResize(ui *uiterm.Ui, width, height int) {
|
||||
tw := b.TreeWidth
|
||||
ui.SetBounds(uiViewLogo, 0, 0, 9, 1)
|
||||
ui.SetBounds(uiViewTop, 9, 0, width-6, 1)
|
||||
ui.SetBounds(uiViewStatus, width-6, 0, width, 1)
|
||||
ui.SetBounds(uiViewInput, 0, height-1, width, height)
|
||||
ui.SetBounds(uiViewInputStatus, 0, height-2, width, height-1)
|
||||
ui.SetBounds(uiViewOutput, 0, 1, width-20, height-2)
|
||||
ui.SetBounds(uiViewTree, width-20, 1, width, height-2)
|
||||
ui.SetBounds(uiViewOutput, 0, 1, width-tw, height-2)
|
||||
ui.SetBounds(uiViewTree, width-tw, 1, width, height-2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user