From 101e23780e5f8bc97f5683f5901fbd31f56ce29e Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sat, 28 Dec 2024 00:46:18 -0500 Subject: First attempt at auto-resize --- internal/ui/style.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'internal/ui/style.go') diff --git a/internal/ui/style.go b/internal/ui/style.go index 75d2f70..bab94ca 100644 --- a/internal/ui/style.go +++ b/internal/ui/style.go @@ -10,6 +10,7 @@ const ( textNorm = "#A7AFB1" textFaint = "#6F797B" geomFg = "#ACB3B5" + textWarn = "#EA9139" TabSepLeft = "[" TabSepMid = " | " @@ -23,6 +24,7 @@ const ( SliderMinWidth = 22 // 1 ASCII change every 2.05 deg. avg SliderMaxWidth = 90 // 2 ASCII change per deg. + BoxOffsetW, BoxOffsetH = 2, 2 ) type sliderOpts struct { @@ -42,6 +44,7 @@ type StyleSheet struct { InputPrompt lg.Style InputText lg.Style Notice lg.Style + TooSmall lg.Style Quit lg.Style Boxed lg.Style Sliders sliderOpts @@ -65,15 +68,15 @@ func init() { style = StyleSheet{ TabSel: baseStyle.Inherit(lg.NewStyle(). - Foreground(lg.Color(textSel)). Underline(true). - Bold(true)), + Bold(true)). + Foreground(lg.Color(textSel)), TabNorm: baseStyle.Inherit(lg.NewStyle(). - Foreground(lg.Color(textFaint)). Underline(false). Faint(true). - Bold(false)), + Bold(false)). + Foreground(lg.Color(textFaint)), TabGeom: baseStyle.Inherit(lg.NewStyle(). Foreground(lg.Color(geomFg))), @@ -95,9 +98,14 @@ func init() { Notice: baseStyle.Inherit(lg.NewStyle(). Bold(true)), + TooSmall: baseStyle.Inherit(lg.NewStyle(). + Bold(true)). + Blink(true). + Foreground(lg.Color(textWarn)), + Quit: baseStyle.Inherit(lg.NewStyle(). - Foreground(lg.Color(textSel)). - Bold(true)), + Bold(true)). + Foreground(lg.Color(textSel)), Boxed: baseStyle.Inherit(lg.NewStyle(). Border(lg.RoundedBorder())), -- cgit v1.2.3