From 4ffa9aaf3532f455b9e88c8c04c3be55ecbe5d06 Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Fri, 7 Apr 2023 03:15:55 +0200 Subject: [PATCH] UI experimentation --- internal/tuimode/tuimode.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/tuimode/tuimode.go b/internal/tuimode/tuimode.go index e2dcefd..70b04b4 100644 --- a/internal/tuimode/tuimode.go +++ b/internal/tuimode/tuimode.go @@ -26,6 +26,8 @@ var ( Foreground(lipgloss.Color("#FFFFFF")) helpStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(241)) + listStyle = lipgloss.NewStyle(). + BorderStyle(lipgloss.DoubleBorder()) ) type status int @@ -55,7 +57,7 @@ type model struct { } func (m *model) initLists(width, height int) { - defaultList := list.New([]list.Item{}, list.NewDefaultDelegate(), width, height) + defaultList := list.New([]list.Item{}, list.NewDefaultDelegate(), width, height/2) // Disable features we wont need defaultList.SetShowTitle(false) @@ -152,7 +154,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case "enter": if m.loaded { m.processSelection() - //return m, nil } case "ctrl+z", "backspace": if m.focused > 0 { @@ -209,7 +210,7 @@ func (m model) View() string { titleStyle.Render("Press ENTER/RETURN to set up all these devices for passthrough."), titleStyle.Render("This list should only contain the USB controller you want to use."), ) } - return lipgloss.JoinVertical(lipgloss.Left, title, m.lists[m.focused].View()) + return lipgloss.JoinVertical(lipgloss.Left, title, listStyle.Render(m.lists[m.focused].View())) } else { return "Loading..." }