summaryrefslogtreecommitdiff
path: root/tui.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2024-12-02 20:53:22 +0300
committerGrail Finder <wohilas@gmail.com>2024-12-02 20:53:22 +0300
commitb9a5c681a6620d9cf68e42fc4ec15d860f50ecd1 (patch)
tree25975b9becfbefd817089e60a074d93695e41ea3 /tui.go
parenta5ab816c9434022159548ac0d1872160b3c8908d (diff)
Feat: add default styleHEADmaster
Diffstat (limited to 'tui.go')
-rw-r--r--tui.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/tui.go b/tui.go
index 03119a1..caebb82 100644
--- a/tui.go
+++ b/tui.go
@@ -41,6 +41,20 @@ Press Enter to go back
)
func init() {
+ theme := tview.Theme{
+ PrimitiveBackgroundColor: tcell.ColorDefault,
+ ContrastBackgroundColor: tcell.ColorGray,
+ MoreContrastBackgroundColor: tcell.ColorNavy,
+ BorderColor: tcell.ColorGray,
+ TitleColor: tcell.ColorRed,
+ GraphicsColor: tcell.ColorBlue,
+ PrimaryTextColor: tcell.ColorOlive,
+ SecondaryTextColor: tcell.ColorYellow,
+ TertiaryTextColor: tcell.ColorOrange,
+ InverseTextColor: tcell.ColorPurple,
+ ContrastSecondaryTextColor: tcell.ColorLime,
+ }
+ tview.Styles = theme
app = tview.NewApplication()
pages = tview.NewPages()
textArea = tview.NewTextArea().
@@ -64,6 +78,10 @@ func init() {
AddItem(position, 0, 1, false)
updateStatusLine := func() {
position.SetText(fmt.Sprintf(indexLine, botRespMode, activeChatName))
+ // INFO: way too ineffective; it should be optional or removed
+ // tv := textView.GetText(false)
+ // cq := quotesRE.ReplaceAllString(tv, `[orange]$1[white]`)
+ // textView.SetText(starRE.ReplaceAllString(cq, `[yellow]$1[white]`))
}
chatOpts := []string{"cancel", "new", "rename current"}
chatList, err := loadHistoryChats()
@@ -142,6 +160,7 @@ func init() {
textView.SetText(chatToText(cfg.ShowSys))
sysModal.ClearButtons()
pages.RemovePage("sys")
+ app.SetFocus(textArea)
}
})
editArea = tview.NewTextArea().