Adjust news header syle

This commit is contained in:
Christian Rocha 2020-11-24 18:24:31 -05:00
commit 2d10fb8749
3 changed files with 22 additions and 12 deletions

View file

@ -36,15 +36,15 @@ var (
statusBarBg = common.NewColorPair("#242424", "#E6E6E6")
// Styling funcs
statusBarScrollPosStyle = newStyle(common.NewColorPair("#5A5A5A", "#949494"), statusBarBg)
statusBarNoteStyle = newStyle(statusBarNoteFg, statusBarBg)
statusBarHelpStyle = newStyle(statusBarNoteFg, common.NewColorPair("#323232", "#DCDCDC"))
statusBarStashDotStyle = newStyle(common.Green, statusBarBg)
statusBarMessageStyle = newStyle(mintGreen, darkGreen)
statusBarMessageStashIconStyle = newStyle(mintGreen, darkGreen)
statusBarMessageScrollPosStyle = newStyle(mintGreen, darkGreen)
statusBarMessageHelpStyle = newStyle(common.NewColorPair("#B6FFE4", "#B6FFE4"), common.Green)
helpViewStyle = newStyle(statusBarNoteFg, common.NewColorPair("#1B1B1B", "#f2f2f2"))
statusBarScrollPosStyle = newStyle(common.NewColorPair("#5A5A5A", "#949494"), statusBarBg, false)
statusBarNoteStyle = newStyle(statusBarNoteFg, statusBarBg, false)
statusBarHelpStyle = newStyle(statusBarNoteFg, common.NewColorPair("#323232", "#DCDCDC"), false)
statusBarStashDotStyle = newStyle(common.Green, statusBarBg, false)
statusBarMessageStyle = newStyle(mintGreen, darkGreen, false)
statusBarMessageStashIconStyle = newStyle(mintGreen, darkGreen, false)
statusBarMessageScrollPosStyle = newStyle(mintGreen, darkGreen, false)
statusBarMessageHelpStyle = newStyle(common.NewColorPair("#B6FFE4", "#B6FFE4"), common.Green, false)
helpViewStyle = newStyle(statusBarNoteFg, common.NewColorPair("#1B1B1B", "#f2f2f2"), false)
)
type contentRenderedMsg string

View file

@ -880,7 +880,7 @@ func stashView(m stashModel) string {
if m.state == stashStateFilterNotes || m.state == stashStateShowFiltered {
logoOrFilter = m.filterInput.View()
} else if m.state == stashStateShowNews {
logoOrFilter = glowLogoView(" Newsfeed ")
logoOrFilter += newsTitleStyle(" News ")
}
var pagination string

View file

@ -40,11 +40,21 @@ var (
dullYellowFg = newFgStyle(common.NewColorPair("#9BA92F", "#6BCB94")) // renders light green on light backgrounds
redFg = newFgStyle(common.Red)
faintRedFg = newFgStyle(common.FaintRed)
newsTitleStyle = newStyle(
common.NewColorPair(common.Indigo.String(), common.Cream.String()),
common.NewColorPair(common.Cream.String(), common.Indigo.String()),
true,
)
)
// Returns a termenv style with foreground and background options.
func newStyle(fg, bg common.ColorPair) func(string) string {
return te.Style{}.Foreground(fg.Color()).Background(bg.Color()).Styled
func newStyle(fg, bg common.ColorPair, bold bool) func(string) string {
s := te.Style{}.Foreground(fg.Color()).Background(bg.Color())
if bold {
s = s.Bold()
}
return s.Styled
}
// Returns a new termenv style with background options only.