Bladeren bron

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

ayntgl 4 jaren geleden
bovenliggende
commit
2b3066f7c7
2 gewijzigde bestanden met toevoegingen van 27 en 8 verwijderingen
  1. 12 1
      main.go
  2. 15 7
      util/config.go

+ 12 - 1
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)

+ 15 - 7
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",