refactor(ui): remove NewApp()
This commit is contained in:
parent
097b96f841
commit
85c7754a18
2 changed files with 3 additions and 16 deletions
|
|
@ -57,7 +57,9 @@ func main() {
|
|||
}{}
|
||||
}
|
||||
|
||||
app = ui.NewApp(onAppInputCapture)
|
||||
app = tview.NewApplication().
|
||||
EnableMouse(true).
|
||||
SetInputCapture(onAppInputCapture)
|
||||
guildsTreeView = ui.NewGuildsTreeView(onGuildsTreeViewSelected)
|
||||
channelsTreeView = ui.NewChannelsTreeView(onChannelsTreeViewSelected)
|
||||
messagesTextView = ui.NewMessagesTextView(app)
|
||||
|
|
|
|||
15
ui/app.go
15
ui/app.go
|
|
@ -1,15 +0,0 @@
|
|||
package ui
|
||||
|
||||
import (
|
||||
"github.com/gdamore/tcell/v2"
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
// NewApp creates and returns a new application.
|
||||
func NewApp(onAppInputCapture func(*tcell.EventKey) *tcell.EventKey) (app *tview.Application) {
|
||||
app = tview.NewApplication().
|
||||
EnableMouse(true).
|
||||
SetInputCapture(onAppInputCapture)
|
||||
|
||||
return app
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue