Skip to content

Commit

Permalink
fix: color glitch with bright terminal background
Browse files Browse the repository at this point in the history
When a black on white terminal coloring is used,
there are a couple of spots where the background-color
is not displayed correctly.

This affects the header bar and source column in the package list.

Addresses #6
  • Loading branch information
moson-mo committed Apr 14, 2022
1 parent 416c76e commit 0eddda3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
29 changes: 12 additions & 17 deletions internal/pacseek/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ func (ps *UI) drawPackages(packages []Package) {

ps.packages.SetCellSimple(i+1, 0, pkg.Name)
ps.packages.SetCell(i+1, 1, &tview.TableCell{
Text: pkg.Source,
Color: color,
Text: pkg.Source,
Color: color,
BackgroundColor: tcell.ColorBlack,
})
ps.packages.SetCell(i+1, 2, &tview.TableCell{
Text: installed,
Expand All @@ -208,21 +209,15 @@ func (ps *UI) drawPackages(packages []Package) {

// adds header row to package table
func (ps *UI) drawPackagesHeader() {
ps.packages.SetCell(0, 0, &tview.TableCell{
Text: "Package",
NotSelectable: true,
Color: tcell.ColorYellow,
})
ps.packages.SetCell(0, 1, &tview.TableCell{
Text: "Source",
NotSelectable: true,
Color: tcell.ColorYellow,
})
ps.packages.SetCell(0, 2, &tview.TableCell{
Text: "Installed",
NotSelectable: true,
Color: tcell.ColorYellow,
})
columns := []string{"Package", "Source", "Installed"}
for i, col := range columns {
ps.packages.SetCell(0, i, &tview.TableCell{
Text: col,
NotSelectable: true,
Color: tcell.ColorYellow,
BackgroundColor: tcell.ColorBlack,
})
}
}

// composes a map with fields and values (package information) for our details box
Expand Down
7 changes: 4 additions & 3 deletions internal/pacseek/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ func (ps *UI) setupComponents() {
SetBorder(true).
SetTitleAlign(tview.AlignLeft)
ps.packages.SetCell(0, 0, &tview.TableCell{
Text: "Package - Source - Installed",
NotSelectable: true,
Color: tcell.ColorYellow,
Text: "Package - Source - Installed",
NotSelectable: true,
Color: tcell.ColorYellow,
BackgroundColor: tcell.ColorBlack,
})
ps.spinner.SetText("").
SetBorder(true)
Expand Down

0 comments on commit 0eddda3

Please sign in to comment.