From 23cb9e1d89f688c30a0476ea990d60bba4ea6015 Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sat, 7 Sep 2024 15:43:19 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style(ui):=20Adjust=20border=20s?= =?UTF-8?q?tyling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- colors.sh | 20 ++++++++++++++++++++ main.go | 24 ++++++++++++------------ 2 files changed, 32 insertions(+), 12 deletions(-) create mode 100755 colors.sh diff --git a/colors.sh b/colors.sh new file mode 100755 index 0000000..bcd6150 --- /dev/null +++ b/colors.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +usage() { + echo "show-ansi-colors " + exit 0 +} + +(( $# < 1 )) && usage + +show_ansi_colors() { + local colors=$1 + echo "showing $colors ansi colors:" + for (( n=0; n < $colors; n++ )) do + printf " [%d] $(tput setaf $n)%s$(tput sgr0)" $n "wMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMw +" + done + echo +} + +show_ansi_colors "$@" \ No newline at end of file diff --git a/main.go b/main.go index 60f088a..b16f7a9 100644 --- a/main.go +++ b/main.go @@ -25,10 +25,9 @@ type menu struct { func initialModel() menu { return menu{ - current: 0, - keys: keys, - help: help.New(), - inputStyle: gloss.NewStyle().Foreground(gloss.Color("#FF75B7")), + current: 0, + keys: keys, + help: help.New(), } } @@ -163,15 +162,16 @@ func (m menu) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } func (m menu) View() string { - mainStyle := gloss.NewStyle(). - Width(int(float64(width) * 0.65)). - BorderStyle(gloss.NormalBorder()). - BorderForeground(gloss.Color("63")) + borderStyle := gloss.NewStyle(). + BorderStyle(gloss.RoundedBorder()). + BorderForeground(gloss.Color("5")). + Padding(0, 1) - sidebarStyle := gloss.NewStyle(). - Width(int(float64(width) * 0.3)). - BorderStyle(gloss.NormalBorder()). - BorderForeground(gloss.Color("63")) + mainStyle := borderStyle. + Width(int(float64(width) * 0.65)) + + sidebarStyle := borderStyle. + Width(int(float64(width) * 0.3)) mainContent := "" sidebarContent := ""