summary refs log tree commit diff stats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
authorKalyan Sriram <coder.kalyan@gmail.com>2020-07-27 01:03:55 -0700
committerReto Brunner <reto@labrat.space>2020-07-30 19:35:59 +0200
commit1ff687ca2b0821c2cacc1fa725abb3302d2af9da (patch)
treeb84df04a645c1fd2ee94d7a08f2f9c717930e9ab /widgets/aerc.go
parent1bab1754f095a5c0537fc639d0214f6efbb340a2 (diff)
downloadaerc-1ff687ca2b0821c2cacc1fa725abb3302d2af9da.tar.gz
Implement style configuration.
Introduce the ability to configure stylesets, allowing customization of
aerc's look (color scheme, font weight, etc). Default styleset is
installed to /path/to/aerc/stylesets/default.
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go20
1 files changed, 14 insertions, 6 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 4913be3..692e00d 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -51,8 +51,8 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger,
 
 	tabs := ui.NewTabs(&conf.Ui)
 
-	statusbar := ui.NewStack()
-	statusline := NewStatusLine()
+	statusbar := ui.NewStack(conf.Ui)
+	statusline := NewStatusLine(conf.Ui)
 	statusbar.Push(statusline)
 
 	grid := ui.NewGrid().Rows([]ui.GridSpec{
@@ -76,7 +76,7 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger,
 		logger:     logger,
 		statusbar:  statusbar,
 		statusline: statusline,
-		prompts:    ui.NewStack(),
+		prompts:    ui.NewStack(conf.Ui),
 		tabs:       tabs,
 	}
 
@@ -382,12 +382,20 @@ func (aerc *Aerc) SetStatus(status string) *StatusMessage {
 	return aerc.statusline.Set(status)
 }
 
+func (aerc *Aerc) SetError(status string) *StatusMessage {
+	return aerc.statusline.SetError(status)
+}
+
 func (aerc *Aerc) PushStatus(text string, expiry time.Duration) *StatusMessage {
 	return aerc.statusline.Push(text, expiry)
 }
 
-func (aerc *Aerc) PushError(text string) {
-	aerc.PushStatus(text, 10*time.Second).Color(tcell.ColorDefault, tcell.ColorRed)
+func (aerc *Aerc) PushError(text string) *StatusMessage {
+	return aerc.statusline.PushError(text)
+}
+
+func (aerc *Aerc) PushSuccess(text string) *StatusMessage {
+	return aerc.statusline.PushSuccess(text)
 }
 
 func (aerc *Aerc) focus(item ui.Interactive) {
@@ -555,7 +563,7 @@ func (aerc *Aerc) CloseDialog() {
 func (aerc *Aerc) GetPassword(title string, prompt string) (chText chan string, chErr chan error) {
 	chText = make(chan string, 1)
 	chErr = make(chan error, 1)
-	getPasswd := NewGetPasswd(title, prompt, func(pw string, err error) {
+	getPasswd := NewGetPasswd(title, prompt, aerc.conf, func(pw string, err error) {
 		defer func() {
 			close(chErr)
 			close(chText)
previous revision' href='/akspecs/ranger/blame/TODO?h=v1.4.3&id=5a528b93e78d51552e9247d1a4d5183c43e1cf53'>^
4b826595 ^
757e1f55 ^
277ecc9e ^
9983328c ^
33cb688a ^
a1274aba ^
b42eb058 ^
b13518af ^
316ff5a9 ^
fc486c60 ^
b4934e42 ^
2c1d2db0 ^
291ca616 ^
50845f37 ^
039c03ef ^
af6658b3 ^
efe2d7a3 ^
f0df3fa5 ^
a986e2bd ^

3fe38754 ^

6a8d5d23 ^
aad61455 ^
7a268c8b ^

efdc7b16 ^
636f69d3 ^
d3c262a9 ^
4be8b401 ^



d955e3f0 ^
75013dc7 ^
67bb838c ^
a808a661 ^
bba8d293 ^
2a64495f ^
5e449699 ^
8895b130 ^

7b04e507 ^
87db0130 ^
dd4a4145 ^
8f2f1767 ^
db1721dd ^
aea5cf92 ^
b624bd94 ^
69d1220f ^
6099d9a3 ^
9207e83c ^
f7db061b ^
6099d9a3 ^
6f43de0a ^




fca1fc4f ^
f70ee6b2 ^
0db4c9b2 ^
b2d63ef5 ^
291ca616 ^
d994d0d6 ^
01c89bb5 ^
c776804d ^
dab4db44 ^

34c131ef ^
66c5bb93 ^
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93