summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-30 16:50:14 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-30 16:50:14 -0400
commit4bdc0f37150db34eabbacef3c967a6643638265a (patch)
tree038855a715b1278b24940969ccd4b3d9f7223b87 /widgets
parentfd27a2baf6ecf5e534560e4ed79b3f1c1f1f6b3f (diff)
downloadaerc-4bdc0f37150db34eabbacef3c967a6643638265a.tar.gz
Minor refactoring to header view
Diffstat (limited to 'widgets')
-rw-r--r--widgets/msgviewer.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index a4fec09..ecfac3b 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -206,16 +206,21 @@ type HeaderView struct {
 
 func (hv *HeaderView) Draw(ctx *ui.Context) {
 	size := runewidth.StringWidth(hv.Name)
-	var style tcell.Style
+	var (
+		hstyle tcell.Style
+		vstyle tcell.Style
+	)
+	// TODO: Make this more robust and less dumb
 	if hv.Name == "PGP" {
-		style = tcell.StyleDefault.Foreground(tcell.ColorGreen)
+		vstyle = tcell.StyleDefault.Foreground(tcell.ColorGreen)
+		hstyle = tcell.StyleDefault.Bold(true)
 	} else {
-		style = tcell.StyleDefault
+		vstyle = tcell.StyleDefault
+		hstyle = tcell.StyleDefault.Bold(true)
 	}
-	ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', style)
-	ctx.Printf(0, 0,
-		tcell.StyleDefault.Bold(true), hv.Name)
-	ctx.Printf(size, 0, style, " "+hv.Value)
+	ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', vstyle)
+	ctx.Printf(0, 0, hstyle, hv.Name)
+	ctx.Printf(size, 0, vstyle, " "+hv.Value)
 }
 
 func (hv *HeaderView) Invalidate() {
kspecs/aerc/commit/widgets/directories.go?h=0.1.0&id=a782b709d1312bfe80dda7c864de96ba1c854bc2'>a782b70 ^
2349b7d ^

cf66462 ^
257affc ^
2349b7d ^




257affc ^
2349b7d ^
257affc ^

a782b70 ^
257affc ^
cf66462 ^


2349b7d ^



cf66462 ^

2750f99 ^
cf66462 ^


2349b7d ^
257affc ^
2349b7d ^


257affc ^


2349b7d ^


24196d2 ^
a782b70 ^





257affc ^




cf66462 ^
257affc ^





cf66462 ^






257affc ^

2349b7d ^
b60999c ^




































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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142