added Draw Function for expanded View

The Draw function is decided with the help of the InsidePlaylist boolean
value.
This commit is contained in:
aditya-K2 2021-10-18 12:18:51 +05:30
parent 1fa411fb1d
commit e137dc6c1e
1 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,15 @@ func main() {
Random, _ = strconv.ParseBool(_v["random"])
Repeat, _ = strconv.ParseBool(_v["repeat"])
UI.expandedView.SetDrawFunc(func(s tcell.Screen, x, y, width, height int) (int, int, int, int) {
if InsidePlaylist {
UpdatePlaylist(*conn, UI.expandedView)
} else {
Update(*conn, dirTree.children, UI.expandedView)
}
return UI.expandedView.GetInnerRect()
})
UI.expandedView.SetInputCapture(func(e *tcell.EventKey) *tcell.EventKey {
switch e.Rune() {
case 108: // L : Key