Ver código fonte

feat(util): add mouse field to config (#34)

* feat(util): add mouse field to config

* docs(util): update doc comment
rigormorrtiss 4 anos atrás
pai
commit
89818721c3
2 arquivos alterados com 4 adições e 2 exclusões
  1. 1 1
      discordo.go
  2. 3 1
      util/config.go

+ 1 - 1
discordo.go

@@ -58,7 +58,7 @@ func main() {
 	}
 
 	app = tview.NewApplication().
-		EnableMouse(true).
+		EnableMouse(conf.Mouse).
 		SetInputCapture(onAppInputCapture)
 	guildsTreeView = ui.NewGuildsTreeView(onGuildsTreeViewSelected)
 	channelsTreeView = ui.NewChannelsTreeView(onChannelsTreeViewSelected)

+ 3 - 1
util/config.go

@@ -12,8 +12,9 @@ type Theme struct {
 	Borders    bool   `json:"borders,omitempty"`
 }
 
-// Config consists for properties, such as theme, that may be customized by the user.
+// Config consists of fields, such as theme, mouse, so on, that may be customized by the user.
 type Config struct {
+	Mouse            bool   `json:"mouse,omitempty"`
 	GetMessagesLimit uint   `json:"getMessagesLimit,omitempty"`
 	Theme            *Theme `json:"theme,omitempty"`
 }
@@ -26,6 +27,7 @@ func NewConfig() *Config {
 	}
 
 	var c Config = Config{
+		Mouse:            true,
 		GetMessagesLimit: 50,
 		Theme: &Theme{
 			Borders: true,