Skip to content

Commit

Permalink
Adjust "secondary" green color in stash highlight + help
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Dec 24, 2020
1 parent 379dc74 commit dd936ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ui/stashhelp.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (h helpColumn) render(height int) (rows []string) {
switch k {
case "s":
k = greenFg(k)
v = dimGreenFg(v)
v = semiDimGreenFg(v)
default:
k = grayFg(k)
v = midGrayFg(v)
Expand Down Expand Up @@ -216,7 +216,7 @@ func (m stashModel) miniHelpView(entries ...string) string {
switch k {
case "s":
k = greenFg(k)
v = dimGreenFg(v)
v = semiDimGreenFg(v)
default:
k = grayFg(k)
v = midGrayFg(v)
Expand Down
20 changes: 8 additions & 12 deletions ui/stashitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ func stashItemView(b *strings.Builder, m stashModel, index int, md *markdown) {

isSelected := index == m.cursor()
isFiltering := m.filterState == filtering
singleFilteredItem := isFiltering && len(m.getVisibleMarkdowns()) == 1

// If there are multiple items being filtered we don't highlight a selected
// If there are multiple items being filtered don't highlight a selected
// item in the results. If we've filtered down to one item, however,
// highlight that first item since pressing return will open it.
singleFilteredItem :=
isFiltering && len(m.getVisibleMarkdowns()) == 1

if isSelected && !isFiltering || singleFilteredItem {
// Selected item

Expand All @@ -73,11 +71,12 @@ func stashItemView(b *strings.Builder, m stashModel, index int, md *markdown) {
gutter = greenFg(verticalLine)
icon = dimGreenFg(icon)
title = greenFg(title)
date = dimGreenFg(date)
date = semiDimGreenFg(date)
} else {
gutter = dullFuchsiaFg(verticalLine)
icon = dullFuchsiaFg(icon)
if m.currentSection().key == filterSection && m.filterState == filterApplied || singleFilteredItem {
if m.currentSection().key == filterSection &&
m.filterState == filterApplied || singleFilteredItem {
s := termenv.Style{}.Foreground(lib.Fuschia.Color())
title = styleFilteredText(title, m.filterInput.Value(), s, s.Underline())
} else {
Expand All @@ -89,15 +88,14 @@ func stashItemView(b *strings.Builder, m stashModel, index int, md *markdown) {
} else {
// Regular (non-selected) items

gutter = " "

if m.common.latestFileStashed == md.stashID &&
m.statusMessage == stashedStatusMessage {
gutter = " "
icon = dimGreenFg(icon)
title = greenFg(title)
date = dimGreenFg(date)
date = semiDimGreenFg(date)
} else if md.docType == NewsDoc {
gutter = " "

if isFiltering && m.filterInput.Value() == "" {
title = dimIndigoFg(title)
date = dimSubtleIndigoFg(date)
Expand All @@ -113,7 +111,6 @@ func stashItemView(b *strings.Builder, m stashModel, index int, md *markdown) {
} else {
title = dimNormalFg(title)
}
gutter = " "
date = dimBrightGrayFg(date)
} else {
icon = greenFg(icon)
Expand All @@ -123,7 +120,6 @@ func stashItemView(b *strings.Builder, m stashModel, index int, md *markdown) {
s := termenv.Style{}.Foreground(lib.NewColorPair("#dddddd", "#1a1a1a").Color())
title = styleFilteredText(title, m.filterInput.Value(), s, s.Underline())
}
gutter = " "
date = brightGrayFg(date)
}
}
Expand Down
5 changes: 3 additions & 2 deletions ui/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ var (
midGrayFg = newFgStyle(lib.NewColorPair("#4A4A4A", "#B2B2B2"))
darkGrayFg = newFgStyle(lib.NewColorPair("#3C3C3C", "#DDDADA"))

greenFg = newFgStyle(lib.NewColorPair("#04B575", "#04B575"))
dimGreenFg = newFgStyle(lib.NewColorPair("#0B5137", "#72D2B0"))
greenFg = newFgStyle(lib.NewColorPair("#04B575", "#04B575"))
semiDimGreenFg = newFgStyle(lib.NewColorPair("#036B46", "#35D79C"))
dimGreenFg = newFgStyle(lib.NewColorPair("#0B5137", "#72D2B0"))

fuchsiaFg = newFgStyle(lib.Fuschia)
dimFuchsiaFg = newFgStyle(lib.NewColorPair("#99519E", "#F1A8FF"))
Expand Down

0 comments on commit dd936ac

Please sign in to comment.