mirror of
https://github.com/shokinn/hosts-go.git
synced 2025-08-23 16:43:02 +00:00
feat: add view mode status bar
This commit is contained in:
parent
49bf61f8e5
commit
9748c2dde8
5 changed files with 45 additions and 5 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
var (
|
||||
listStyle = lipgloss.NewStyle().Padding(0, 1)
|
||||
detailStyle = lipgloss.NewStyle().Padding(0, 1)
|
||||
statusStyle = lipgloss.NewStyle().Padding(0, 1).Foreground(lipgloss.Color("240")).Background(lipgloss.Color("236"))
|
||||
)
|
||||
|
||||
// View renders the two-pane layout.
|
||||
|
@ -36,5 +37,9 @@ func (m Model) View() string {
|
|||
|
||||
left := listStyle.Width(m.width / 2).Height(m.height).Render(listView)
|
||||
right := detailStyle.Width(m.width - m.width/2).Height(m.height).Render(detail.String())
|
||||
return lipgloss.JoinHorizontal(lipgloss.Top, left, right)
|
||||
panes := lipgloss.JoinHorizontal(lipgloss.Top, left, right)
|
||||
|
||||
status := fmt.Sprintf("VIEW MODE • %d entries", len(m.hosts.Entries))
|
||||
bar := statusStyle.Width(m.width).Render(status)
|
||||
return lipgloss.JoinVertical(lipgloss.Left, panes, bar)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue