Преглед на файлове

Rename ui.NewApplication() to ui.NewApp()

rigormorrtiss преди 4 години
родител
ревизия
14fa4cca81
променени са 2 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 2 2
      discordo.go
  2. 3 2
      ui/app.go

+ 2 - 2
discordo.go

@@ -32,7 +32,7 @@ func main() {
 	channelsList = ui.NewChannelsList(onChannelsListSelected)
 	messagesTextView = ui.NewMessagesTextView(onMessagesTextViewChanged)
 	mainFlex = ui.NewMainFlex(guildsDropDown, channelsList, messagesTextView)
-	app = ui.NewApplication()
+	app = ui.NewApp()
 
 	token := util.GetPassword("token")
 	if token != "" {
@@ -45,7 +45,7 @@ func main() {
 		app.SetRoot(loginModal, true)
 	}
 
-	if err := app.EnableMouse(true).Run(); err != nil {
+	if err := app.Run(); err != nil {
 		panic(err)
 	}
 }

+ 3 - 2
ui/app.go

@@ -4,8 +4,9 @@ import (
 	"github.com/rivo/tview"
 )
 
-func NewApplication() (app *tview.Application) {
-	app = tview.NewApplication()
+func NewApp() (app *tview.Application) {
+	app = tview.NewApplication().
+		EnableMouse(true)
 
 	return
 }