From 2d10fb874931cbc4d7bc05ebad2eb24c38822cd2 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 24 Nov 2020 18:24:31 -0500 Subject: [PATCH] Adjust news header syle --- ui/pager.go | 18 +++++++++--------- ui/stash.go | 2 +- ui/styles.go | 14 ++++++++++++-- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ui/pager.go b/ui/pager.go index 7d4c1d8..c47c940 100644 --- a/ui/pager.go +++ b/ui/pager.go @@ -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 diff --git a/ui/stash.go b/ui/stash.go index 25c4b21..3a128eb 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -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 diff --git a/ui/styles.go b/ui/styles.go index d8b4971..d30a24e 100644 --- a/ui/styles.go +++ b/ui/styles.go @@ -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.