Apply preview-bg color to preview border of all shapes

This commit is contained in:
Junegunn Choi 2021-04-06 18:01:02 +09:00
parent 15f4cfb6d9
commit 3d37a5ba1d
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -693,13 +693,17 @@ func (w *LightWindow) drawBorder() {
} }
func (w *LightWindow) drawBorderHorizontal(top, bottom bool) { func (w *LightWindow) drawBorderHorizontal(top, bottom bool) {
color := ColBorder
if w.preview {
color = ColPreviewBorder
}
if top { if top {
w.Move(0, 0) w.Move(0, 0)
w.CPrint(ColBorder, repeat(w.border.horizontal, w.width)) w.CPrint(color, repeat(w.border.horizontal, w.width))
} }
if bottom { if bottom {
w.Move(w.height-1, 0) w.Move(w.height-1, 0)
w.CPrint(ColBorder, repeat(w.border.horizontal, w.width)) w.CPrint(color, repeat(w.border.horizontal, w.width))
} }
} }
@ -708,14 +712,18 @@ func (w *LightWindow) drawBorderVertical(left, right bool) {
if !left || !right { if !left || !right {
width++ width++
} }
color := ColBorder
if w.preview {
color = ColPreviewBorder
}
for y := 0; y < w.height; y++ { for y := 0; y < w.height; y++ {
w.Move(y, 0) w.Move(y, 0)
if left { if left {
w.CPrint(ColBorder, string(w.border.vertical)) w.CPrint(color, string(w.border.vertical))
} }
w.CPrint(ColBorder, repeat(' ', width)) w.CPrint(color, repeat(' ', width))
if right { if right {
w.CPrint(ColBorder, string(w.border.vertical)) w.CPrint(color, string(w.border.vertical))
} }
} }
} }