From 2b3066f7c73b5923f6bb06df91d4006480cd3550 Mon Sep 17 00:00:00 2001 From: ayntgl <90600421+ayntgl@users.noreply.github.com> Date: Sat, 20 Nov 2021 21:54:09 +0400 Subject: [PATCH] ui: remove borders and switch with focus borders by default (#103) --- main.go | 13 ++++++++++++- util/config.go | 22 +++++++++++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index d2b5827..4e55f45 100644 --- a/main.go +++ b/main.go @@ -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) diff --git a/util/config.go b/util/config.go index 3cecffa..f84c0c2 100644 --- a/util/config.go +++ b/util/config.go @@ -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",