| 1178 | } |
| 1179 | |
| 1180 | func (m *ircModel) viewForm() string { |
| 1181 | labels := []string{ |
| 1182 | " Custom Server Name ", |
| 1183 | " Server:Port ", |
| 1184 | " TLS ", |
| 1185 | " Nick / Username / Real ", |
| 1186 | " Channels (comma) ", |
| 1187 | " SUBMIT ", |
| 1188 | } |
| 1189 | var b strings.Builder |
| 1190 | b.WriteString(stylePinkB.Render(" ↈ Add New IRC Connection") + "\n\n") |
| 1191 | for i := 0; i < int(totalFields); i++ { |
| 1192 | label := labels[i] |
| 1193 | if i == int(m.formSel) && m.focus == paneRight { |
| 1194 | label = styleDarkSel.Render(label) |
| 1195 | } else { |
| 1196 | label = stylePink.Render(label) |
| 1197 | } |
| 1198 | if i == int(fieldSubmit) { |
| 1199 | b.WriteString(label + "\n\n") |
| 1200 | } else { |
| 1201 | b.WriteString(label + "\n" + m.formInputs[i].View() + "\n\n") |
| 1202 | } |
| 1203 | } |
| 1204 | b.WriteString(styleDim.Render("↑/↓ fields · Enter submit · ←/→ panes")) |
| 1205 | return b.String() |
| 1206 | } |
| 1207 | |
| 1208 | func (m *ircModel) viewChat() string { |
| 1209 | var header strings.Builder |