diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/buffer/buffer.go | 4 | ||||
| -rw-r--r-- | client/channel_window.go | 6 | ||||
| -rw-r--r-- | client/cmd_window.go | 13 | ||||
| -rw-r--r-- | client/colors.go | 9 | ||||
| -rw-r--r-- | client/ui.go | 1 |
5 files changed, 15 insertions, 18 deletions
diff --git a/client/buffer/buffer.go b/client/buffer/buffer.go index fea88a9..b57ec26 100644 --- a/client/buffer/buffer.go +++ b/client/buffer/buffer.go @@ -89,9 +89,9 @@ func (b *Buffer) Show(id string) (atTop bool) { defer tui.Pop() for m := b.bottom; m != nil; m = m.prev { - var bg int32 = tui.Black + var bg int32 = 232 if m.odd { - bg = 236 + bg = 233 } tui.Push(m.msg.Id(), tui.Box { Width: tui.Fill, Height: tui.Children, diff --git a/client/channel_window.go b/client/channel_window.go index 2a2e82f..e5e7e84 100644 --- a/client/channel_window.go +++ b/client/channel_window.go @@ -133,11 +133,7 @@ func (m channelMsg) showDate(bg int32) { } func (m channelMsg) Show(odd bool) { - var bg int32 = tui.Black - if odd { - bg = 236 - } - + var bg int32 = colorDefault[odd] switch m.Kind { case "join": tui.Push("", tui.Box { diff --git a/client/cmd_window.go b/client/cmd_window.go index 6a69bb9..d468385 100644 --- a/client/cmd_window.go +++ b/client/cmd_window.go @@ -37,18 +37,9 @@ func (m logMsg) Show(odd bool) { var style *tui.Style switch m.logType { case logErr: - var bg int32 = tui.Red - if odd { - bg = tui.BrightRed - } - style = &tui.Style {Bg: bg, Fg: tui.White} + style = &tui.Style {Bg: colorErr[odd], Fg: tui.White} case logCmd: - var bg int32 = tui.Blue - if odd { - bg = tui.BrightBlue - } - style = &tui.Style {Bg: bg, Fg: tui.Black} - default: + style = &tui.Style {Bg: colorCmd[odd], Fg: tui.White} } tui.Push("", tui.Box { diff --git a/client/colors.go b/client/colors.go new file mode 100644 index 0000000..3922e95 --- /dev/null +++ b/client/colors.go @@ -0,0 +1,9 @@ +package main + +type msgColor map[bool]int32 + +var ( + colorDefault = msgColor {false: 232, true: 233} + colorErr = msgColor {false: 88, true: 124} + colorCmd = msgColor {false: 54, true: 55} +) diff --git a/client/ui.go b/client/ui.go index 386645e..de9a0fb 100644 --- a/client/ui.go +++ b/client/ui.go @@ -61,6 +61,7 @@ func (a *application) show() { s := tui.Size() tui.Push("", tui.Box { Width: tui.BoxSize(s.Width), Height: tui.BoxSize(s.Height), + Style: &tui.Style {Fg: tui.White, Bg: colorDefault[false]}, }) a.getWin().Buffer().Show("buffer") |
