From 4776d42ccc4f1a7cda02d5e31510031ffc92ea3a Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Fri, 7 Feb 2025 19:52:11 +0200 Subject: User settings colors are now runtime-friendly except for fields which have an issue (effects all popups and anything else that uses them), seems to be an issue in charm --- internal/client/ui/field/field.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'internal/client/ui/field/field.go') diff --git a/internal/client/ui/field/field.go b/internal/client/ui/field/field.go index 8cdaced..5ce8a10 100644 --- a/internal/client/ui/field/field.go +++ b/internal/client/ui/field/field.go @@ -6,6 +6,7 @@ import ( "github.com/charmbracelet/lipgloss" "github.com/kyren223/eko/internal/client/ui" + "github.com/kyren223/eko/internal/client/ui/colors" ) type Model struct { @@ -67,7 +68,9 @@ func (m Model) View() string { Render(header + m.ErrorStyle.Render(" - "+error)) } - field := ui.AddBorderHeader(header, 1, style, m.Input.View()+m.icon) + input := m.Input.View() + m.icon + + field := ui.AddBorderHeader(header, 1, style, input) return field } @@ -84,6 +87,9 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { func (m *Model) Focus() tea.Cmd { m.Input.PromptStyle = m.FocusedTextStyle m.Input.TextStyle = m.FocusedTextStyle + m.Input.Cursor.Style = lipgloss.NewStyle() + // Background(m.FocusedTextStyle.GetForeground()). + // Foreground(m.FocusedTextStyle.GetBackground()) return m.Input.Focus() } @@ -91,6 +97,9 @@ func (m *Model) Blur() { m.Input.Blur() m.Input.PromptStyle = m.BlurredTextStyle m.Input.TextStyle = m.BlurredTextStyle + // m.Input.Cursor.Style = lipgloss.NewStyle(). + // Background(m.BlurredTextStyle.GetForeground()). + // Foreground(m.BlurredTextStyle.GetBackground()) } func (m *Model) SetWidth(width int) { -- cgit v1.3.1