Enha: textarea color update

This commit is contained in:
Grail Finder
2026-02-19 14:22:43 +03:00
parent 76827a71cc
commit 27fdec1361
2 changed files with 19 additions and 13 deletions

View File

@@ -403,11 +403,17 @@ func updateWidgetColors(theme tview.Theme) {
textArea.SetBorderColor(borderColor) textArea.SetBorderColor(borderColor)
textArea.SetTitleColor(titleColor) textArea.SetTitleColor(titleColor)
textArea.SetTextStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor)) textArea.SetTextStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor))
textArea.SetPlaceholderStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor))
// Force textarea refresh by restoring text (SetTextStyle doesn't trigger redraw)
textArea.SetText(textArea.GetText(), true)
editArea.SetBackgroundColor(bgColor) editArea.SetBackgroundColor(bgColor)
editArea.SetBorderColor(borderColor) editArea.SetBorderColor(borderColor)
editArea.SetTitleColor(titleColor) editArea.SetTitleColor(titleColor)
editArea.SetTextStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor)) editArea.SetTextStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor))
editArea.SetPlaceholderStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor))
// Force textarea refresh by restoring text (SetTextStyle doesn't trigger redraw)
editArea.SetText(editArea.GetText(), true)
statusLineWidget.SetBackgroundColor(bgColor) statusLineWidget.SetBackgroundColor(bgColor)
statusLineWidget.SetTextColor(fgColor) statusLineWidget.SetTextColor(fgColor)

26
tui.go
View File

@@ -135,20 +135,20 @@ Press <Enter> or 'x' to return
ContrastSecondaryTextColor: tcell.ColorLime, ContrastSecondaryTextColor: tcell.ColorLime,
}, },
"gruvbox": tview.Theme{ "gruvbox": tview.Theme{
PrimitiveBackgroundColor: tcell.ColorBlack, // Matches #1e1e2e PrimitiveBackgroundColor: tcell.NewHexColor(0x282828), // Background: #282828 (dark gray)
ContrastBackgroundColor: tcell.ColorDarkGoldenrod, // Selected option: warm yellow (#b57614) ContrastBackgroundColor: tcell.ColorDarkGoldenrod, // Selected option: warm yellow (#b57614)
MoreContrastBackgroundColor: tcell.ColorDarkSlateGray, // Non-selected options: dark grayish-blue (#32302f) MoreContrastBackgroundColor: tcell.ColorDarkSlateGray, // Non-selected options: dark grayish-blue (#32302f)
BorderColor: tcell.ColorLightGray, // Light gray (#a89984) BorderColor: tcell.ColorLightGray, // Light gray (#a89984)
TitleColor: tcell.ColorRed, // Red (#fb4934) TitleColor: tcell.ColorRed, // Red (#fb4934)
GraphicsColor: tcell.ColorDarkCyan, // Cyan (#689d6a) GraphicsColor: tcell.ColorDarkCyan, // Cyan (#689d6a)
PrimaryTextColor: tcell.ColorLightGray, // Light gray (#d5c4a1) PrimaryTextColor: tcell.ColorLightGray, // Light gray (#d5c4a1)
SecondaryTextColor: tcell.ColorYellow, // Yellow (#fabd2f) SecondaryTextColor: tcell.ColorYellow, // Yellow (#fabd2f)
TertiaryTextColor: tcell.ColorOrange, // Orange (#fe8019) TertiaryTextColor: tcell.ColorOrange, // Orange (#fe8019)
InverseTextColor: tcell.ColorWhite, // White (#f9f5d7) for selected text InverseTextColor: tcell.ColorWhite, // White (#f9f5d7) for selected text
ContrastSecondaryTextColor: tcell.ColorLightGreen, // Light green (#b8bb26) ContrastSecondaryTextColor: tcell.ColorLightGreen, // Light green (#b8bb26)
}, },
"solarized": tview.Theme{ "solarized": tview.Theme{
PrimitiveBackgroundColor: tcell.NewHexColor(0x1e1e2e), // #1e1e2e for main dropdown box PrimitiveBackgroundColor: tcell.NewHexColor(0x002b36), // Background: #002b36 (base03)
ContrastBackgroundColor: tcell.ColorDarkCyan, // Selected option: cyan (#2aa198) ContrastBackgroundColor: tcell.ColorDarkCyan, // Selected option: cyan (#2aa198)
MoreContrastBackgroundColor: tcell.ColorDarkSlateGray, // Non-selected options: dark blue (#073642) MoreContrastBackgroundColor: tcell.ColorDarkSlateGray, // Non-selected options: dark blue (#073642)
BorderColor: tcell.ColorLightBlue, // Light blue (#839496) BorderColor: tcell.ColorLightBlue, // Light blue (#839496)
@@ -161,7 +161,7 @@ Press <Enter> or 'x' to return
ContrastSecondaryTextColor: tcell.ColorLightCyan, // Light cyan (#93a1a1) ContrastSecondaryTextColor: tcell.ColorLightCyan, // Light cyan (#93a1a1)
}, },
"dracula": tview.Theme{ "dracula": tview.Theme{
PrimitiveBackgroundColor: tcell.NewHexColor(0x1e1e2e), // #1e1e2e for main dropdown box PrimitiveBackgroundColor: tcell.NewHexColor(0x282a36), // Background: #282a36
ContrastBackgroundColor: tcell.ColorDarkMagenta, // Selected option: magenta (#bd93f9) ContrastBackgroundColor: tcell.ColorDarkMagenta, // Selected option: magenta (#bd93f9)
MoreContrastBackgroundColor: tcell.ColorDarkGray, // Non-selected options: dark gray (#44475a) MoreContrastBackgroundColor: tcell.ColorDarkGray, // Non-selected options: dark gray (#44475a)
BorderColor: tcell.ColorLightGray, // Light gray (#f8f8f2) BorderColor: tcell.ColorLightGray, // Light gray (#f8f8f2)