Pointerize Config.Theme
This commit is contained in:
parent
e1a88777a7
commit
a3e9fbd076
2 changed files with 7 additions and 5 deletions
|
|
@ -29,7 +29,9 @@ var (
|
|||
func main() {
|
||||
conf = util.NewConfig()
|
||||
|
||||
tview.Styles = conf.Theme
|
||||
if conf.Theme != nil {
|
||||
tview.Styles = *conf.Theme
|
||||
}
|
||||
|
||||
app = tview.NewApplication().
|
||||
EnableMouse(conf.Mouse).
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ import (
|
|||
|
||||
// Config consists of fields, such as theme, mouse, so on, that may be customized by the user.
|
||||
type Config struct {
|
||||
Token string `json:"token,omitempty"`
|
||||
Mouse bool `json:"mouse,omitempty"`
|
||||
GetMessagesLimit int `json:"getMessagesLimit,omitempty"`
|
||||
Theme tview.Theme `json:"theme,omitempty"`
|
||||
Token string `json:"token,omitempty"`
|
||||
Mouse bool `json:"mouse,omitempty"`
|
||||
GetMessagesLimit int `json:"getMessagesLimit,omitempty"`
|
||||
Theme *tview.Theme `json:"theme,omitempty"`
|
||||
}
|
||||
|
||||
// NewConfig reads the configuration file (if exists) and returns a new config.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue