| 24 |
24 |
|
statusErrStyle = lipgloss.NewStyle(). |
| 25 |
25 |
|
Foreground(lipgloss.Color("1")). |
| 26 |
26 |
|
Bold(true) |
|
27 |
+ |
hintStyle = lipgloss.NewStyle(). |
|
28 |
+ |
Foreground(lipgloss.Color("8")) |
| 27 |
29 |
|
modalStyle = lipgloss.NewStyle(). |
| 28 |
30 |
|
Border(lipgloss.RoundedBorder()). |
| 29 |
31 |
|
BorderForeground(lipgloss.Color("3")). |
|
| 32 |
34 |
|
|
| 33 |
35 |
|
func (m Model) View() tea.View { |
| 34 |
36 |
|
listW, contentW := splitWidths(m.width) |
| 35 |
|
- |
bodyH := splitBodyHeight(m.height) |
|
37 |
+ |
bodyH := splitBodyHeight(m.height - 1) |
| 36 |
38 |
|
|
| 37 |
39 |
|
left := m.renderListPane(listW, bodyH) |
| 38 |
40 |
|
right := m.renderRightPane(contentW, bodyH) |
| 39 |
41 |
|
|
| 40 |
|
- |
base := lipgloss.JoinHorizontal(lipgloss.Top, left, right) |
|
42 |
+ |
body := lipgloss.JoinHorizontal(lipgloss.Top, left, right) |
|
43 |
+ |
footer := m.renderFooter() |
|
44 |
+ |
base := lipgloss.JoinVertical(lipgloss.Left, body, footer) |
| 41 |
45 |
|
|
| 42 |
46 |
|
var overlays []*lipgloss.Layer |
| 43 |
47 |
|
if m.showHelp { |
|
| 131 |
135 |
|
Width(max(w-paneFrameWidth(), 1)). |
| 132 |
136 |
|
Height(max(h-paneFrameHeight(), 1)). |
| 133 |
137 |
|
Render(inner) |
|
138 |
+ |
} |
|
139 |
+ |
|
|
140 |
+ |
func (m Model) renderFooter() string { |
|
141 |
+ |
mode := "local" |
|
142 |
+ |
if m.isRemote { |
|
143 |
+ |
mode = "remote " + m.backend.RemoteURL() |
|
144 |
+ |
} |
|
145 |
+ |
help := m.help.ShortHelpView(m.keys.ShortHelp()) |
|
146 |
+ |
return hintStyle.Render(fmt.Sprintf("[%s] %s", mode, help)) |
| 134 |
147 |
|
} |
| 135 |
148 |
|
|
| 136 |
149 |
|
func centerLayer(w, h int, content string, z int) *lipgloss.Layer { |