diff options
author | y0ast <joost@joo.st> | 2020-11-30 22:07:03 +0000 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-12-18 07:23:22 +0100 |
commit | 03650474e2190ef6e54413d433b3d1f63dc9993e (patch) | |
tree | 3b6f7df5a249eba9382de495553583795052bc3b /widgets | |
parent | af0a2b9a46e5d7f015682ebc1522bd421d7fe3dd (diff) | |
download | aerc-03650474e2190ef6e54413d433b3d1f63dc9993e.tar.gz |
update tcell to v2 and enable TrueColor support
Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/account-wizard.go | 2 | ||||
-rw-r--r-- | widgets/account.go | 2 | ||||
-rw-r--r-- | widgets/aerc.go | 2 | ||||
-rw-r--r-- | widgets/compose.go | 2 | ||||
-rw-r--r-- | widgets/dirlist.go | 2 | ||||
-rw-r--r-- | widgets/exline.go | 2 | ||||
-rw-r--r-- | widgets/getpasswd.go | 2 | ||||
-rw-r--r-- | widgets/msglist.go | 2 | ||||
-rw-r--r-- | widgets/msgviewer.go | 2 | ||||
-rw-r--r-- | widgets/selector.go | 2 | ||||
-rw-r--r-- | widgets/spinner.go | 2 | ||||
-rw-r--r-- | widgets/status.go | 2 | ||||
-rw-r--r-- | widgets/terminal.go | 6 |
13 files changed, 15 insertions, 15 deletions
diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go index f47e97e..71ba6e1 100644 --- a/widgets/account-wizard.go +++ b/widgets/account-wizard.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "github.com/go-ini/ini" "github.com/kyoh86/xdg" diff --git a/widgets/account.go b/widgets/account.go index f279513..fc746a4 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib" diff --git a/widgets/aerc.go b/widgets/aerc.go index b5e8dd1..70bee7c 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -10,7 +10,7 @@ import ( "time" "github.com/emersion/go-message/mail" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "github.com/google/shlex" "golang.org/x/crypto/openpgp" diff --git a/widgets/compose.go b/widgets/compose.go index e139f9a..aab3308 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -16,7 +16,7 @@ import ( "time" "github.com/emersion/go-message/mail" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "github.com/mattn/go-runewidth" "github.com/mitchellh/go-homedir" "github.com/pkg/errors" diff --git a/widgets/dirlist.go b/widgets/dirlist.go index aca1491..5711fe4 100644 --- a/widgets/dirlist.go +++ b/widgets/dirlist.go @@ -7,7 +7,7 @@ import ( "regexp" "sort" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "github.com/mattn/go-runewidth" "git.sr.ht/~sircmpwn/aerc/config" diff --git a/widgets/exline.go b/widgets/exline.go index 692c8e2..24c39c1 100644 --- a/widgets/exline.go +++ b/widgets/exline.go @@ -1,7 +1,7 @@ package widgets import ( - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib" diff --git a/widgets/getpasswd.go b/widgets/getpasswd.go index 3cdc5cf..b5c3d0e 100644 --- a/widgets/getpasswd.go +++ b/widgets/getpasswd.go @@ -3,7 +3,7 @@ package widgets import ( "fmt" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib/ui" diff --git a/widgets/msglist.go b/widgets/msglist.go index 61738a8..827282b 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -5,7 +5,7 @@ import ( "log" "math" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "github.com/mattn/go-runewidth" "git.sr.ht/~sircmpwn/aerc/config" diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 6c69577..216a8c5 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -11,7 +11,7 @@ import ( "strings" "github.com/danwakefield/fnmatch" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "github.com/google/shlex" "github.com/mattn/go-runewidth" diff --git a/widgets/selector.go b/widgets/selector.go index d19d38f..196601b 100644 --- a/widgets/selector.go +++ b/widgets/selector.go @@ -1,7 +1,7 @@ package widgets import ( - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib/ui" diff --git a/widgets/spinner.go b/widgets/spinner.go index 0c72422..f49256a 100644 --- a/widgets/spinner.go +++ b/widgets/spinner.go @@ -5,7 +5,7 @@ import ( "sync/atomic" "time" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib/ui" diff --git a/widgets/status.go b/widgets/status.go index 122ca5f..dfad08c 100644 --- a/widgets/status.go +++ b/widgets/status.go @@ -3,7 +3,7 @@ package widgets import ( "time" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" "github.com/mattn/go-runewidth" "git.sr.ht/~sircmpwn/aerc/config" diff --git a/widgets/terminal.go b/widgets/terminal.go index 77da71e..e83c812 100644 --- a/widgets/terminal.go +++ b/widgets/terminal.go @@ -10,7 +10,7 @@ import ( "github.com/creack/pty" "github.com/ddevault/go-libvterm" - "github.com/gdamore/tcell" + "github.com/gdamore/tcell/v2" ) type vtermKey struct { @@ -406,7 +406,7 @@ func (term *Terminal) styleFromCell(cell *vterm.ScreenCell) tcell.Style { if background.IsDefaultBg() { bg = tcell.ColorDefault } else if background.IsIndexed() { - bg = tcell.Color(background.GetIndex()) + bg = tcell.Color(tcell.PaletteColor(int(background.GetIndex()))) } else if background.IsRgb() { r, g, b := background.GetRGB() bg = tcell.NewRGBColor(int32(r), int32(g), int32(b)) @@ -414,7 +414,7 @@ func (term *Terminal) styleFromCell(cell *vterm.ScreenCell) tcell.Style { if foreground.IsDefaultFg() { fg = tcell.ColorDefault } else if foreground.IsIndexed() { - fg = tcell.Color(foreground.GetIndex()) + fg = tcell.Color(tcell.PaletteColor(int(foreground.GetIndex()))) } else if foreground.IsRgb() { r, g, b := foreground.GetRGB() fg = tcell.NewRGBColor(int32(r), int32(g), int32(b)) |