Close #130 - allow toggle low-priority habits

This commit is contained in:
2022-09-18 19:10:50 +00:00
parent 6d6e4c3a0a
commit b78508c163
2 changed files with 9 additions and 1 deletions

View File

@@ -223,8 +223,10 @@
(_activeBonusEntries)
(_activeTodoEntries))))
(prop &mut :Bool showLowerPriority false)
(method :Bool topPriorityIsActive []
(apply or (for e (_allActiveEntries) e.topPriority)))
?(unless showLowerPriority (apply or (for e (_allActiveEntries) e.topPriority))))
(defMacro topPriority [name]
`(method :Array<Entry> ,name []

View File

@@ -342,6 +342,12 @@
}
null null FlxColor.WHITE 0.9 0.9 true (defAndReturn prop xKey "escape") backToEntryWindow true)]
(set priorityWindow pw))))
(let [showOrHide (if model.showLowerPriority "Hide" "Show")]
(_makeText "$showOrHide lower-priority habits and tasks" 0
->_
(defAndCall method toggleLowerPriority
(set model.showLowerPriority !model.showLowerPriority)
(refreshModel))))
(set entryWindow.textColor (FlxColor.RED.getDarkened))
(_makeText "Delete a habit or task" 0
->_