From c4fb002ae0b48aed1a0d2b8fa84b6be795f83e2d Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 24 Nov 2024 14:26:28 -0500 Subject: feat: Update master (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Attemp at using goreleaser * Fix syntax error in .goreleaser.yml * fix: Check roadmap feature for clipboard (README) * feat: add help menu at the bottom (#4) * MVP for a help menu * fix: commented code is evil * feat: box-drawing UI (#6) * feat: add help at the bottom (#5) * Attemp at using goreleaser * Fix syntax error in .goreleaser.yml * fix: Check roadmap feature for clipboard (README) * feat: add help menu at the bottom (#4) * MVP for a help menu * fix: commented code is evil * Update generated VHS GIF * feat: Rounded corner box UI * Update roadmap checkmarks in README --------- Co-authored-by: vhs-action 📼 --------- Co-authored-by: vhs-action 📼 --- internal/switcher/switcher.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'internal/switcher') diff --git a/internal/switcher/switcher.go b/internal/switcher/switcher.go index fdf91af..589b029 100644 --- a/internal/switcher/switcher.go +++ b/internal/switcher/switcher.go @@ -67,9 +67,17 @@ func (m Model) View() string { } pickerView := m.pickers[m.active].View() + boxStyle := lipgloss.NewStyle().Border(lipgloss.RoundedBorder(), true, true, false, true) w := lipgloss.Width(pickerView) + pickerView = boxStyle.Render(pickerView) + + m.preview.SetWidth(w) + boxStyle = boxStyle.Border(lipgloss.RoundedBorder(), false, true, false, true) + previewStr := boxStyle.Render(m.preview.View()) m.help.Styles.ShortKey.Width(w) + boxStyle = boxStyle.Border(lipgloss.RoundedBorder(), false, true, true, true).Width(w) + var helpstr string if m.fullHelp { helpstr = m.help.FullHelpView(m.AllKeys()) @@ -81,10 +89,12 @@ func (m Model) View() string { helpstr = m.help.FullHelpView(shortKeys()) } + helpstr = boxStyle.Render(helpstr) + return fmt.Sprintf("%s\n%s\n%s\n%v", tabs, pickerView, - m.preview.View(), + previewStr, helpstr, ) } -- cgit v1.2.3