summaryrefslogtreecommitdiff
path: root/internal/client/ui
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-02-07 17:21:48 +0200
committerKyren223 <Kyren223@proton.me>2025-02-07 17:21:48 +0200
commit9065ca31d05fa7c9dc2a8073f5a534a55dc860f5 (patch)
treed3c930226438923384bfb5df056eff6982a0db22 /internal/client/ui
parentffb5935164568fc20ce3b803312fe0d51bfa43bf (diff)
Networklist colors are now runtime-friendly
Diffstat (limited to 'internal/client/ui')
-rw-r--r--internal/client/ui/core/networklist/networklist.go23
1 files changed, 11 insertions, 12 deletions
diff --git a/internal/client/ui/core/networklist/networklist.go b/internal/client/ui/core/networklist/networklist.go
index 2e6b970..16afda1 100644
--- a/internal/client/ui/core/networklist/networklist.go
+++ b/internal/client/ui/core/networklist/networklist.go
@@ -12,16 +12,6 @@ import (
"github.com/kyren223/eko/internal/packet"
)
-var (
- sepStyle = lipgloss.NewStyle().Width(0).BorderBackground(colors.BackgroundDimmer).
- Border(lipgloss.ThickBorder(), false, true, false, false)
-
- selectedIndicator = "šŸ­€\nā–Œ\nšŸ­›"
- notification = " \nā——\n "
-
- backgroundStyle = lipgloss.NewStyle().Background(colors.BackgroundDimmer)
-)
-
const SignalsIndex = -1
type Model struct {
@@ -45,6 +35,12 @@ func (m Model) Init() tea.Cmd {
}
func (m Model) View() string {
+ selectedIndicator := lipgloss.NewStyle().
+ Foreground(colors.White).Render("šŸ­€\nā–Œ\nšŸ­›")
+
+ notification := lipgloss.NewStyle().
+ Foreground(colors.White).Render(" \nā——\n ")
+
var builder strings.Builder
pings := 0
@@ -123,13 +119,16 @@ func (m Model) View() string {
result := builder.String()
- sep := sepStyle.Height(ui.Height)
+ sep := lipgloss.NewStyle().Width(0).Height(ui.Height).
+ BorderBackground(colors.BackgroundDimmer).BorderForeground(colors.White).
+ Border(lipgloss.ThickBorder(), false, true, false, false)
if m.focus {
sep = sep.BorderForeground(colors.Focus)
}
+
result = lipgloss.JoinHorizontal(lipgloss.Top, result, sep.String())
- return backgroundStyle.Render(result)
+ return lipgloss.NewStyle().Background(colors.BackgroundDimmer).Render(result)
}
func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {