소스 검색

refactor(ui): remove NewApp()

rigormorrtiss 4 년 전
부모
커밋
85c7754a18
2개의 변경된 파일3개의 추가작업 그리고 16개의 파일을 삭제
  1. 3 1
      discordo.go
  2. 0 15
      ui/app.go

+ 3 - 1
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)

+ 0 - 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
-}