|
|
@@ -1,14 +1,69 @@
|
|
|
package config
|
|
|
|
|
|
-import "github.com/rivo/tview"
|
|
|
+import (
|
|
|
+ "github.com/rivo/tview"
|
|
|
+)
|
|
|
+
|
|
|
+type BorderPreset struct {
|
|
|
+ Horizontal rune
|
|
|
+ Vertical rune
|
|
|
+ TopLeft rune
|
|
|
+ TopRight rune
|
|
|
+ BottomLeft rune
|
|
|
+ BottomRight rune
|
|
|
+}
|
|
|
+
|
|
|
+func (p *BorderPreset) UnmarshalTOML(v any) error {
|
|
|
+ switch v.(string) {
|
|
|
+ case "double":
|
|
|
+ *p = BorderPreset{
|
|
|
+ Horizontal: tview.BoxDrawingsDoubleHorizontal,
|
|
|
+ Vertical: tview.BoxDrawingsDoubleVertical,
|
|
|
+ TopLeft: tview.BoxDrawingsDoubleDownAndRight,
|
|
|
+ TopRight: tview.BoxDrawingsDoubleDownAndLeft,
|
|
|
+ BottomLeft: tview.BoxDrawingsDoubleUpAndRight,
|
|
|
+ BottomRight: tview.BoxDrawingsDoubleUpAndLeft,
|
|
|
+ }
|
|
|
+ case "thick":
|
|
|
+ *p = BorderPreset{
|
|
|
+ Horizontal: tview.BoxDrawingsHeavyHorizontal,
|
|
|
+ Vertical: tview.BoxDrawingsHeavyVertical,
|
|
|
+ TopLeft: tview.BoxDrawingsHeavyDownAndRight,
|
|
|
+ TopRight: tview.BoxDrawingsHeavyDownAndLeft,
|
|
|
+ BottomLeft: tview.BoxDrawingsHeavyUpAndRight,
|
|
|
+ BottomRight: tview.BoxDrawingsHeavyUpAndLeft,
|
|
|
+ }
|
|
|
+ case "round":
|
|
|
+ *p = BorderPreset{
|
|
|
+ Horizontal: tview.BoxDrawingsLightHorizontal,
|
|
|
+ Vertical: tview.BoxDrawingsLightVertical,
|
|
|
+ TopLeft: tview.BoxDrawingsLightArcDownAndRight,
|
|
|
+ TopRight: tview.BoxDrawingsLightArcDownAndLeft,
|
|
|
+ BottomLeft: tview.BoxDrawingsLightArcUpAndRight,
|
|
|
+ BottomRight: tview.BoxDrawingsLightArcUpAndLeft,
|
|
|
+ }
|
|
|
+ case "hidden":
|
|
|
+ *p = BorderPreset{
|
|
|
+ Horizontal: ' ',
|
|
|
+ Vertical: ' ',
|
|
|
+ TopLeft: ' ',
|
|
|
+ TopRight: ' ',
|
|
|
+ BottomLeft: ' ',
|
|
|
+ BottomRight: ' ',
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return nil
|
|
|
+}
|
|
|
|
|
|
type (
|
|
|
BorderTheme struct {
|
|
|
Enabled bool `toml:"enabled"`
|
|
|
Padding [4]int `toml:"padding"`
|
|
|
|
|
|
- Color string `toml:"color"`
|
|
|
- ActiveColor string `toml:"active_color"`
|
|
|
+ Color string `toml:"color"`
|
|
|
+ ActiveColor string `toml:"active_color"`
|
|
|
+ Preset BorderPreset `toml:"preset"`
|
|
|
}
|
|
|
|
|
|
Theme struct {
|
|
|
@@ -48,6 +103,14 @@ func defaultTheme() Theme {
|
|
|
|
|
|
Color: "default",
|
|
|
ActiveColor: "gold",
|
|
|
+ Preset: BorderPreset{
|
|
|
+ Horizontal: tview.Borders.Horizontal,
|
|
|
+ Vertical: tview.Borders.Vertical,
|
|
|
+ TopLeft: tview.Borders.TopLeft,
|
|
|
+ TopRight: tview.Borders.TopRight,
|
|
|
+ BottomLeft: tview.Borders.BottomLeft,
|
|
|
+ BottomRight: tview.Borders.BottomRight,
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
BackgroundColor: "default",
|