wip: profile / channel bar mvp
This commit is contained in:
parent
f6260c85e7
commit
69263f0aea
49
cairde.go
49
cairde.go
|
@ -96,25 +96,13 @@ var (
|
|||
mainStyle = lipgloss.NewStyle().
|
||||
BorderStyle(lipgloss.NormalBorder())
|
||||
|
||||
viewportStyle = lipgloss.NewStyle().
|
||||
BorderStyle(lipgloss.NormalBorder()).
|
||||
BorderLeft(false).
|
||||
BorderRight(false).
|
||||
BorderTop(false).
|
||||
BorderBottom(true)
|
||||
viewportStyle = lipgloss.NewStyle()
|
||||
|
||||
profileNameButtonStyle = lipgloss.NewStyle().
|
||||
Height(1).
|
||||
Bold(true).
|
||||
Underline(true)
|
||||
profileNameButtonStyle = lipgloss.NewStyle()
|
||||
|
||||
inputStyle = lipgloss.NewStyle().
|
||||
Height(1).
|
||||
BorderStyle(lipgloss.NormalBorder()).
|
||||
BorderLeft(false).
|
||||
BorderRight(false).
|
||||
BorderTop(true).
|
||||
BorderBottom(false)
|
||||
channelBarStyle = lipgloss.NewStyle()
|
||||
|
||||
inputStyle = lipgloss.NewStyle()
|
||||
)
|
||||
|
||||
type profile struct {
|
||||
|
@ -380,7 +368,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
m.height = msg.Height - 2
|
||||
m.viewport = viewport.New(
|
||||
m.width,
|
||||
m.height-4,
|
||||
m.height-3,
|
||||
)
|
||||
|
||||
case tea.KeyMsg:
|
||||
|
@ -502,7 +490,15 @@ func (m model) View() string {
|
|||
// TODO: adjust when more panes are available
|
||||
m.viewport.SetContent(strings.Join(*m.statusMsgs, "\n"))
|
||||
|
||||
statusButton := profileNameButtonStyle.Render("status")
|
||||
channelBar := channelBarStyle.
|
||||
Width(m.width).
|
||||
AlignVertical(lipgloss.Center).
|
||||
Render(lipgloss.NewStyle().Background(lipgloss.Color("14")).Foreground(lipgloss.Color("#fffff")).Render("N/A"))
|
||||
|
||||
statusButton := profileNameButtonStyle.
|
||||
Width(m.width).
|
||||
AlignVertical(lipgloss.Center).
|
||||
Render(lipgloss.NewStyle().Background(lipgloss.Color("26")).Foreground(lipgloss.Color("#fffff")).Render("status"))
|
||||
|
||||
var profileNames []string
|
||||
for _, profile := range m.profiles {
|
||||
|
@ -525,14 +521,23 @@ func (m model) View() string {
|
|||
Width(m.width).
|
||||
Render(m.viewport.View()),
|
||||
|
||||
lipgloss.JoinHorizontal(
|
||||
lipgloss.Left,
|
||||
channelBar,
|
||||
),
|
||||
|
||||
lipgloss.JoinHorizontal(
|
||||
lipgloss.Left,
|
||||
buttonBar...,
|
||||
),
|
||||
|
||||
inputStyle.
|
||||
Width(m.width).
|
||||
Render(m.input.View()),
|
||||
lipgloss.PlaceVertical(
|
||||
1,
|
||||
lipgloss.Bottom,
|
||||
inputStyle.
|
||||
Width(m.width).
|
||||
Render(m.input.View()),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
Reference in New Issue