From 85c7754a1868afa4f0a25415e3d52b88d75a77dc Mon Sep 17 00:00:00 2001 From: rigormorrtiss Date: Thu, 19 Aug 2021 17:54:15 +0400 Subject: [PATCH] refactor(ui): remove NewApp() --- discordo.go | 4 +++- ui/app.go | 15 --------------- 2 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 ui/app.go diff --git a/discordo.go b/discordo.go index 3087f71..4794aea 100644 --- a/discordo.go +++ b/discordo.go @@ -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) diff --git a/ui/app.go b/ui/app.go deleted file mode 100644 index 9379ccc..0000000 --- a/ui/app.go +++ /dev/null @@ -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 -}