diff options
| author | Hubert Hirtz <hubert@hirtz.pm> | 2020-11-07 11:41:19 +0100 |
|---|---|---|
| committer | Hubert Hirtz <hubert@hirtz.pm> | 2020-11-07 11:41:19 +0100 |
| commit | 27060a93cafc28e47929e776d54a64725f7b8b03 (patch) | |
| tree | e0c0fbe0a632dcb1d02540ce76d206066cc3f817 /ui | |
| parent | Default user/real to nickname if unspecified (diff) | |
Configurable channel list width
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/ui.go | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -9,6 +9,7 @@ import ( type Config struct { NickColWidth int + ChanColWidth int AutoComplete func(cursorIdx int, text []rune) []Completion } @@ -178,24 +179,24 @@ func (ui *UI) InputEnter() (content string) { func (ui *UI) Resize() { w, h := ui.screen.Size() - ui.e.Resize(w - 25 - ui.config.NickColWidth) - ui.bs.ResizeTimeline(w-16, h-2, ui.config.NickColWidth) + ui.e.Resize(w - 9 - ui.config.ChanColWidth - ui.config.NickColWidth) + ui.bs.ResizeTimeline(w-ui.config.ChanColWidth, h-2, ui.config.NickColWidth) } func (ui *UI) Draw() { w, h := ui.screen.Size() - ui.e.Draw(ui.screen, 25+ui.config.NickColWidth, h-1) + ui.e.Draw(ui.screen, 9+ui.config.ChanColWidth+ui.config.NickColWidth, h-1) - ui.bs.DrawTimeline(ui.screen, 16, 0, ui.config.NickColWidth) - ui.bs.DrawVerticalBufferList(ui.screen, 0, 0, 16, h) - ui.drawStatusBar(16, h-2, w-16) + ui.bs.DrawTimeline(ui.screen, ui.config.ChanColWidth, 0, ui.config.NickColWidth) + ui.bs.DrawVerticalBufferList(ui.screen, 0, 0, ui.config.ChanColWidth, h) + ui.drawStatusBar(ui.config.ChanColWidth, h-2, w-ui.config.ChanColWidth) - for x := 16; x < 25+ui.config.NickColWidth; x++ { + for x := ui.config.ChanColWidth; x < 9+ui.config.ChanColWidth+ui.config.NickColWidth; x++ { ui.screen.SetContent(x, h-1, ' ', nil, tcell.StyleDefault) } st := tcell.StyleDefault.Foreground(colorFromCode(IdentColor(ui.prompt))) - printIdent(ui.screen, 23, h-1, ui.config.NickColWidth, st, ui.prompt) + printIdent(ui.screen, ui.config.ChanColWidth+7, h-1, ui.config.NickColWidth, st, ui.prompt) ui.screen.Show() } |
