add configurable tree pane width and message logging

This commit is contained in:
Username
2026-02-24 09:25:41 +01:00
parent fc1aaf354b
commit 6d3146270d

6
ui.go
View File

@@ -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)
}