ui: remove borders and switch with focus borders by default (#103)

This commit is contained in:
ayntgl 2021-11-20 21:54:09 +04:00 • committed by GitHub
parent b8d09403e7
commit 2b3066f7c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 8 deletions

13
main.go
View file

@ -25,7 +25,18 @@ var (
func main() {
conf = util.NewConfig()
tview.Borders = conf.Borders
tview.Borders.Horizontal = conf.Borders.Horizontal
tview.Borders.Vertical = conf.Borders.Vertical
tview.Borders.TopLeft = conf.Borders.TopLeft
tview.Borders.TopRight = conf.Borders.TopRight
tview.Borders.BottomLeft = conf.Borders.BottomLeft
tview.Borders.BottomRight = conf.Borders.BottomRight
tview.Borders.HorizontalFocus = conf.Borders.HorizontalFocus
tview.Borders.VerticalFocus = conf.Borders.VerticalFocus
tview.Borders.TopLeftFocus = conf.Borders.TopLeftFocus
tview.Borders.TopRightFocus = conf.Borders.TopRightFocus
tview.Borders.BottomLeftFocus = conf.Borders.BottomLeftFocus
tview.Borders.BottomRightFocus = conf.Borders.BottomRightFocus
tview.Styles.PrimitiveBackgroundColor = tcell.GetColor(conf.Theme.Background)
tview.Styles.ContrastBackgroundColor = tcell.GetColor(conf.Theme.Background)

View file

@ -44,12 +44,6 @@ type borders struct {
BottomLeft rune
BottomRight rune
LeftT rune
RightT rune
TopT rune
BottomT rune
Cross rune
HorizontalFocus rune
VerticalFocus rune
TopLeftFocus rune
@ -91,7 +85,21 @@ func NewConfig() *Config {
Notifications: true,
UserAgent: userAgent,
GetMessagesLimit: 50,
Borders: tview.Borders,
Borders: borders{
Horizontal: 0,
Vertical: 0,
TopLeft: 0,
TopRight: 0,
BottomLeft: 0,
BottomRight: 0,
HorizontalFocus: tview.BoxDrawingsLightHorizontal,
VerticalFocus: tview.BoxDrawingsLightVertical,
TopLeftFocus: tview.BoxDrawingsLightDownAndRight,
TopRightFocus: tview.BoxDrawingsLightDownAndLeft,
BottomLeftFocus: tview.BoxDrawingsLightUpAndRight,
BottomRightFocus: tview.BoxDrawingsLightUpAndLeft,
},
Theme: theme{
Background: "black",