From 0fc7c61dfb25f0fece59fc58dcff69f1158d5469 Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Mon, 15 Nov 2021 21:49:42 +0530 Subject: [PATCH] Changing the Color of the Autocomplete Menu --- App.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/App.go b/App.go index 49cacf1..7b1eb4b 100644 --- a/App.go +++ b/App.go @@ -1,8 +1,8 @@ package main import ( + "github.com/aditya-K2/tview" "github.com/gdamore/tcell/v2" - "github.com/rivo/tview" ) var IMG_X, IMG_Y, IMG_W, IMG_H int @@ -31,6 +31,10 @@ func newApplication(r *Renderer) *Application { }) searchBar.SetTitle("Search").SetTitleAlign(tview.AlignLeft) + searchBar.SetAutocompleteBackgroundColor(tcell.GetColor("#15191a")) + searchBar.SetAutocompleteSelectBackgroundColor(tcell.GetColor("#e5e5e5")) + searchBar.SetAutocompleteMainTextColor(tcell.GetColor("#7f7f7f")) + searchBar.SetAutocompleteSelectedTextColor(tcell.GetColor("#111111")) Navbar.SetBorder(true) Navbar.SetSelectable(true, false) Navbar.SetCell(0, 0, tview.NewTableCell("PlayList")) @@ -63,6 +67,15 @@ func newApplication(r *Renderer) *Application { App := tview.NewApplication() App.SetRoot(rootPages, true).SetFocus(expandedView) + searchBar.SetDoneFunc(func(k tcell.Key) { + switch k { + case tcell.KeyEscape: + { + App.SetFocus(expandedView) + } + } + }) + return &Application{ App: App, ExpandedView: expandedView,