diff options
| author | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-16 17:34:28 +0200 |
|---|---|---|
| committer | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-16 17:34:28 +0200 |
| commit | 34e3264e22ba0524b124f4d350f154e276a7fee8 (patch) | |
| tree | ebe755ad9c30eab81c82341f6f20e69e817d7d3d /ui/ui.go | |
| parent | Fix +typing=active being sent incorrectly (diff) | |
ui: Configurable nick column width
Diffstat (limited to 'ui/ui.go')
| -rw-r--r-- | ui/ui.go | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -8,17 +8,24 @@ import ( "github.com/gdamore/tcell" ) +type Config struct { + NickColWidth int +} + type UI struct { screen tcell.Screen Events chan tcell.Event exit atomic.Value // bool + config Config bs bufferList e editor } -func New() (ui *UI, err error) { - ui = &UI{} +func New(config Config) (ui *UI, err error) { + ui = &UI{ + config: config, + } ui.screen, err = tcell.NewScreen() if err != nil { @@ -208,6 +215,6 @@ func (ui *UI) Resize() { func (ui *UI) draw() { _, h := ui.screen.Size() ui.e.Draw(ui.screen, h-2) - ui.bs.Draw(ui.screen) + ui.bs.Draw(ui.screen, ui.config.NickColWidth) ui.screen.Show() } |
