build: upgrade tview to latest

This commit is contained in:
ayn2op 2025-06-03 17:51:30 -04:00
parent 23be8cd235
commit 1b5f7dec66
5 changed files with 21 additions and 21 deletions

View file

@ -462,13 +462,7 @@ func (mt *messagesText) showUrlSelector(urls []string, attachments []discord.Att
SetHighlightFullLine(true).
ShowSecondaryText(false).
SetDoneFunc(done)
b := mt.cfg.Theme.Border
p := b.Padding
list.
SetBorder(b.Enabled).
SetBorderColor(tcell.GetColor(b.Color)).
SetBorderPadding(p[0], p[1], p[2], p[3])
list.Box = ui.NewConfiguredBox(list.Box, &mt.cfg.Theme)
list.
SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {

View file

@ -66,19 +66,19 @@ func Run() error {
tview.Styles.PrimitiveBackgroundColor = tcell.GetColor(cfg.Theme.BackgroundColor)
tview.Borders.Horizontal = cfg.Theme.Border.Preset.Horizontal
tview.Borders.Vertical = cfg.Theme.Border.Preset.Vertical
tview.Borders.TopLeft = cfg.Theme.Border.Preset.TopLeft
tview.Borders.TopRight = cfg.Theme.Border.Preset.TopRight
tview.Borders.BottomLeft = cfg.Theme.Border.Preset.BottomLeft
tview.Borders.BottomRight = cfg.Theme.Border.Preset.BottomRight
tview.BordersSet.Horizontal = cfg.Theme.Border.Preset.Horizontal
tview.BordersSet.Vertical = cfg.Theme.Border.Preset.Vertical
tview.BordersSet.TopLeft = cfg.Theme.Border.Preset.TopLeft
tview.BordersSet.TopRight = cfg.Theme.Border.Preset.TopRight
tview.BordersSet.BottomLeft = cfg.Theme.Border.Preset.BottomLeft
tview.BordersSet.BottomRight = cfg.Theme.Border.Preset.BottomRight
tview.Borders.HorizontalFocus = tview.Borders.Horizontal
tview.Borders.VerticalFocus = tview.Borders.Vertical
tview.Borders.TopLeftFocus = tview.Borders.TopLeft
tview.Borders.TopRightFocus = tview.Borders.TopRight
tview.Borders.BottomLeftFocus = tview.Borders.BottomLeft
tview.Borders.BottomRightFocus = tview.Borders.BottomRight
tview.BordersSet.HorizontalFocus = tview.BordersSet.Horizontal
tview.BordersSet.VerticalFocus = tview.BordersSet.Vertical
tview.BordersSet.TopLeftFocus = tview.BordersSet.TopLeft
tview.BordersSet.TopRightFocus = tview.BordersSet.TopRight
tview.BordersSet.BottomLeftFocus = tview.BordersSet.BottomLeft
tview.BordersSet.BottomRightFocus = tview.BordersSet.BottomRight
app = newApp(cfg)
return app.run(tok)

2
go.mod
View file

@ -5,7 +5,7 @@ go 1.24.3
require (
github.com/BurntSushi/toml v1.5.0
github.com/atotto/clipboard v0.1.4
github.com/ayn2op/tview v0.0.0-20250603171947-ff81ec6ed099
github.com/ayn2op/tview v0.0.0-20250603214911-09c86784a7ad
github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb
github.com/diamondburned/arikawa/v3 v3.5.0
github.com/diamondburned/ningen/v3 v3.0.1-0.20240808103805-f1a24c0da3d8

2
go.sum
View file

@ -25,6 +25,8 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/ayn2op/tview v0.0.0-20250603171947-ff81ec6ed099 h1:9i8wZAiqlpnGZufIBy95i3Da2Qar2dBeox6NtINe/FQ=
github.com/ayn2op/tview v0.0.0-20250603171947-ff81ec6ed099/go.mod h1:PuMMP3J7SfW0jgAc1fdABOHJkoGbQIw3jejRAkl0API=
github.com/ayn2op/tview v0.0.0-20250603214911-09c86784a7ad h1:CHZg56bCe8yesbr3smGHljQVODCLENWJYFPERX9MSug=
github.com/ayn2op/tview v0.0.0-20250603214911-09c86784a7ad/go.mod h1:PuMMP3J7SfW0jgAc1fdABOHJkoGbQIw3jejRAkl0API=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=

View file

@ -11,7 +11,6 @@ func NewConfiguredBox(box *tview.Box, cfg *config.Theme) *tview.Box {
t := cfg.Title
p := b.Padding
box.
SetBorder(cfg.Border.Enabled).
SetBorderColor(tcell.GetColor(b.Color)).
SetBorderPadding(p[0], p[1], p[2], p[3]).
SetTitleAlign(int(t.Align)).
@ -23,6 +22,11 @@ func NewConfiguredBox(box *tview.Box, cfg *config.Theme) *tview.Box {
box.SetBorderColor(tcell.GetColor(b.Color))
box.SetTitleColor(tcell.GetColor(t.Color))
})
if b.Enabled {
box.SetBorders(tview.BordersAll)
}
return box
}