1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

WTF-400 Bittrex extracted to new config format

This commit is contained in:
Chris Cummer
2019-04-13 15:43:50 -07:00
parent fbf89448af
commit 3db2848169
6 changed files with 75 additions and 40 deletions

View File

@@ -6,17 +6,17 @@ import (
)
type Settings struct {
Common *cfg.Common
common *cfg.Common
FilePath string
filePath string
}
func NewSettingsFromYAML(ymlConfig *config.Config) *Settings {
localConfig, _ := ymlConfig.Get("wtf.mods.todo")
settings := Settings{
Common: cfg.NewCommonSettingsFromYAML(ymlConfig),
FilePath: localConfig.UString("filename"),
common: cfg.NewCommonSettingsFromYAML(ymlConfig),
filePath: localConfig.UString("filename"),
}
return &settings

View File

@@ -53,7 +53,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
app: app,
settings: settings,
filePath: settings.FilePath,
filePath: settings.filePath,
list: checklist.NewChecklist(),
pages: pages,
}
@@ -257,8 +257,8 @@ func (widget *Widget) modalFocus(form *tview.Form) {
}
func (widget *Widget) modalForm(lbl, text string) *tview.Form {
form := tview.NewForm().SetFieldBackgroundColor(wtf.ColorFor(widget.settings.Common.Colors.Background))
form.SetButtonsAlign(tview.AlignCenter).SetButtonTextColor(wtf.ColorFor(widget.settings.Common.Colors.Text))
form := tview.NewForm().SetFieldBackgroundColor(wtf.ColorFor(widget.settings.common.Colors.Background))
form.SetButtonsAlign(tview.AlignCenter).SetButtonTextColor(wtf.ColorFor(widget.settings.common.Colors.Text))
form.AddInputField(lbl, text, 60, nil, nil)