Rename AppView -> ViewConext

This commit is contained in:
Adriano Caloiaro 2020-03-04 17:58:35 -05:00
parent 4bbed7e194
commit 3aace117c0
No known key found for this signature in database
GPG key ID: 9FFD0E7601F166AB
2 changed files with 6 additions and 5 deletions

View file

@ -7,7 +7,7 @@ import (
)
// CreateAppContext creates the application context
func CreateAppContext(view *views.AppView) *AppContext {
func CreateAppContext(view *views.ViewContext) *AppContext {
ctx := &AppContext{View: view}
return ctx
@ -20,5 +20,5 @@ type AppContext struct {
DifmToken string
IsPlaying bool
SpeakerInitialized bool
View *views.AppView
View *views.ViewContext
}

View file

@ -8,7 +8,8 @@ import (
"github.com/rivo/tview"
)
type AppView struct {
// ViewContext holds references to all the top-level UI elements in the application
type ViewContext struct {
App *tview.Application
ChannelList *tview.List
FavoriteList *tview.List
@ -30,8 +31,8 @@ type UIKeybinding struct {
}
// CreateAppView creates the primary application view of di-tui
func CreateAppView() *AppView {
return &AppView{
func CreateAppView() *ViewContext {
return &ViewContext{
App: tview.NewApplication(),
ChannelList: createChannelList(),
FavoriteList: createFavoriteList(),