summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-19 12:21:25 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-19 12:21:25 +0300
commit76827a71cc745b5fc6529e79ee8b76737e534262 (patch)
treee40b51eea1723d553aa5b8bc79c15864766cfa62
parent3a9a7dbe996ac0deb6cb83654a70c5b229137a62 (diff)
Enha: colorscheme to change background color
-rw-r--r--popups.go40
1 files changed, 38 insertions, 2 deletions
diff --git a/popups.go b/popups.go
index 26457b5..a39f160 100644
--- a/popups.go
+++ b/popups.go
@@ -388,6 +388,42 @@ func showFileCompletionPopup(filter string) {
app.SetFocus(widget)
}
+func updateWidgetColors(theme tview.Theme) {
+ bgColor := theme.PrimitiveBackgroundColor
+ fgColor := theme.PrimaryTextColor
+ borderColor := theme.BorderColor
+ titleColor := theme.TitleColor
+
+ textView.SetBackgroundColor(bgColor)
+ textView.SetTextColor(fgColor)
+ textView.SetBorderColor(borderColor)
+ textView.SetTitleColor(titleColor)
+
+ textArea.SetBackgroundColor(bgColor)
+ textArea.SetBorderColor(borderColor)
+ textArea.SetTitleColor(titleColor)
+ textArea.SetTextStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor))
+
+ editArea.SetBackgroundColor(bgColor)
+ editArea.SetBorderColor(borderColor)
+ editArea.SetTitleColor(titleColor)
+ editArea.SetTextStyle(tcell.StyleDefault.Background(bgColor).Foreground(fgColor))
+
+ statusLineWidget.SetBackgroundColor(bgColor)
+ statusLineWidget.SetTextColor(fgColor)
+ statusLineWidget.SetBorderColor(borderColor)
+ statusLineWidget.SetTitleColor(titleColor)
+
+ helpView.SetBackgroundColor(bgColor)
+ helpView.SetTextColor(fgColor)
+ helpView.SetBorderColor(borderColor)
+ helpView.SetTitleColor(titleColor)
+
+ searchField.SetBackgroundColor(bgColor)
+ searchField.SetBorderColor(borderColor)
+ searchField.SetTitleColor(titleColor)
+}
+
// showColorschemeSelectionPopup creates a modal popup to select a colorscheme
func showColorschemeSelectionPopup() {
// Get the list of available colorschemes
@@ -431,10 +467,10 @@ func showColorschemeSelectionPopup() {
schemeListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
// Update the colorscheme
if theme, ok := colorschemes[mainText]; ok {
- // Refresh the UI to apply the new theme
+ tview.Styles = theme
go func() {
app.QueueUpdateDraw(func() {
- tview.Styles = theme
+ updateWidgetColors(theme)
})
}()
}