diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-01-13 15:27:48 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-01-13 15:27:48 -0500 |
commit | 24196d2c6fecae4b6bb52dfec14ac9d7e4bd40d4 (patch) | |
tree | d47b8ea1654a5627811df1e5ad5c5cfd172358fc | |
parent | 60284850f22624a03996e882fcfd6aeb2af88b93 (diff) |
Revert "Render selected list item differently"
This reverts commit 60284850f22624a03996e882fcfd6aeb2af88b93.
-rw-r--r-- | lib/ui/list.go | 1 | ||||
-rw-r--r-- | widgets/directories.go | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/ui/list.go b/lib/ui/list.go index 9caae20..58f304f 100644 --- a/lib/ui/list.go +++ b/lib/ui/list.go @@ -88,7 +88,6 @@ func (list *List) Select(index int) { panic(fmt.Errorf("Attempted to select unknown child")) } list.selected = index - list.Items[list.selected].invalid = true list.Invalidate() } diff --git a/widgets/directories.go b/widgets/directories.go index d765ac2..ff2f6f5 100644 --- a/widgets/directories.go +++ b/widgets/directories.go @@ -53,7 +53,6 @@ func (dirlist *DirectoryList) UpdateList() { return strings.Compare(string(a), string(b)) > 0 }) dirlist.dirs.Set(dirs) - dirlist.dirs.Select(0) } }) } @@ -85,10 +84,7 @@ func (d directoryEntry) Draw(ctx *ui.Context) { } func (d directoryEntry) DrawWithSelected(ctx *ui.Context, selected bool) { - style := tcell.StyleDefault - if selected { - style = style.Background(tcell.ColorWhite).Foreground(tcell.ColorBlack) - } - ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', style) - ctx.Printf(0, 0, style, "%s", d) + // TODO: distinguish the selected item + ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', tcell.StyleDefault) + ctx.Printf(0, 0, tcell.StyleDefault, "%s", d) } |