mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-400 Checklist items now have dynamically-settable checkmark icons
This commit is contained in:
parent
59f0bc6cfc
commit
643840e0da
@ -193,7 +193,10 @@ func (widget *Widget) load() {
|
||||
filePath := fmt.Sprintf("%s/%s", confDir, widget.filePath)
|
||||
|
||||
fileData, _ := wtf.ReadFileBytes(filePath)
|
||||
|
||||
yaml.Unmarshal(fileData, &widget.list)
|
||||
|
||||
widget.setItemChecks()
|
||||
}
|
||||
|
||||
func (widget *Widget) newItem() {
|
||||
@ -227,6 +230,15 @@ func (widget *Widget) persist() {
|
||||
}
|
||||
}
|
||||
|
||||
// setItemChecks rolls through the checklist and ensures that all checklist
|
||||
// items have the correct checked/unchecked icon per the user's preferences
|
||||
func (widget *Widget) setItemChecks() {
|
||||
for _, item := range widget.list.Items {
|
||||
item.CheckedIcon = widget.settings.common.CheckedIcon
|
||||
item.UncheckedIcon = widget.settings.common.UncheckedIcon
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------- Modal Form -------------------- */
|
||||
|
||||
func (widget *Widget) addButtons(form *tview.Form, saveFctn func()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user