feat: added tab bar for channels

* change channels field on client to a slice
* moved the command handler to a separate function
This commit is contained in:
2022-01-20 05:08:39 +02:00
parent f097431b8f
commit 2edc007022
6 changed files with 587 additions and 163 deletions
+72 -1
View File
@@ -28,11 +28,82 @@ var (
Width(ui.MainStyle.GetWidth()).
BorderForeground(lipgloss.Color("105"))
MessagesStyle = lipgloss.NewStyle().
Border(lipgloss.NormalBorder(), true).
Border(lipgloss.NormalBorder(), false, true, true, true).
Width(ui.MainStyle.GetWidth() * 8 / 10).
BorderForeground(lipgloss.Color("#EEE"))
SidePanelStyle = lipgloss.NewStyle().
Border(lipgloss.NormalBorder(), true).
Width(ui.MainStyle.GetWidth() * 2 / 10).
BorderForeground(lipgloss.Color("#EEE"))
activeTabBorder = lipgloss.Border{
Top: "─",
Bottom: " ",
Left: "│",
Right: "│",
TopLeft: "╭",
TopRight: "╮",
BottomLeft: "┘",
BottomRight: "└",
}
highlight = lipgloss.AdaptiveColor{Light: "#874BFD", Dark: "105"}
tabBorder = lipgloss.Border{
Top: "─",
Bottom: "─",
Left: "│",
Right: "│",
TopLeft: "╭",
TopRight: "╮",
BottomLeft: "┴",
BottomRight: "┴",
}
leftArrowBorder = lipgloss.Border{
Top: "─",
Bottom: " ",
Left: "│",
Right: "│",
TopLeft: "╭",
TopRight: "┐",
BottomLeft: "│",
BottomRight: "└",
}
rightArrowBorder = lipgloss.Border{
Top: "─",
Bottom: " ",
Left: "│",
Right: "│",
TopLeft: "┌",
TopRight: "╮",
BottomLeft: "┘",
BottomRight: "│",
}
tab = lipgloss.NewStyle().
Border(tabBorder, true).
Padding(0, 1)
activeTab = tab.Copy().
Border(activeTabBorder, true).
BorderForeground(highlight).
Foreground(lipgloss.Color("105")).
Italic(true).
Bold(true)
leftArrowDim = tab.Copy().
Border(leftArrowBorder, true).
Foreground(lipgloss.Color("#444"))
rightArrowDim = tab.Copy().
Border(rightArrowBorder, true).
Foreground(lipgloss.Color("#444"))
leftArrowLit = tab.Copy().
Border(leftArrowBorder, true).
Foreground(lipgloss.Color("#FFF"))
rightArrowLit = tab.Copy().
Border(rightArrowBorder, true).
Foreground(lipgloss.Color("#FFF"))
tabLine = lipgloss.NewStyle()
)