-
Notifications
You must be signed in to change notification settings - Fork 1
/
simple_style.go
62 lines (54 loc) · 1.6 KB
/
simple_style.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package list
import (
. "github.com/charmbracelet/lipgloss"
)
var border = NewStyle().PaddingLeft(2)
type SimpleAdapterStyle struct {
// normal border is just default style with left padding 2
title, desc /* no border */, filterMatch Style
titleSelected, descSelected, borderSelected, filterMatchSelected Style
}
func (s *SimpleAdapterStyle) Normal(title, desc Style) {
s.title = title
s.desc = desc
s.filterMatch = title.Copy().Underline(true)
}
func (s *SimpleAdapterStyle) Selected(title, desc Style) {
s.titleSelected = title
s.descSelected = desc
s.borderSelected = NewStyle().
BorderStyle(NormalBorder()).
BorderLeft(true).
BorderForeground(title.GetForeground()).
PaddingLeft(1)
s.filterMatchSelected = title.Copy().Underline(true)
}
func SimpleDefaultStyle() (normal, dimmed *SimpleAdapterStyle) {
normal = &SimpleAdapterStyle{}
normal.Normal(
NewStyle().
Foreground(AdaptiveColor{Light: "#1A1A1A", Dark: "#DDDDDD"}),
NewStyle().
Foreground(AdaptiveColor{Light: "#A49FA5", Dark: "#777777"}),
)
normal.Selected(
NewStyle().
Foreground(AdaptiveColor{Light: "#EE6FF8", Dark: "#EE6FF8"}),
NewStyle().
Foreground(AdaptiveColor{Light: "#F793FF", Dark: "#AD58B4"}),
)
dimmed = &SimpleAdapterStyle{}
dimmed.Normal(
NewStyle().
Foreground(AdaptiveColor{Light: "#A49FA5", Dark: "#777777"}),
NewStyle().
Foreground(AdaptiveColor{Light: "#C2B8C2", Dark: "#4D4D4D"}),
)
dimmed.Selected(
NewStyle().
Foreground(AdaptiveColor{Light: "#A49FA5", Dark: "#777777"}),
NewStyle().
Foreground(AdaptiveColor{Light: "#C2B8C2", Dark: "#4D4D4D"}),
)
return
}