Skip to content

Commit 1faadb8

Browse files
committed
Display completed/total number of TODOs (close Onix-Systems#3)
1 parent 8953c97 commit 1faadb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

todo-status-bar/AppDelegate.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, EditTodosWindowControllerDel
4545

4646
private func updateStatusItemButton() {
4747
guard let button = statusItem.button else { return }
48-
button.title = "TODOs"
48+
let totalCount = todoItemsController.todoItems.count
49+
let completedCount = todoItemsController.todoItems.filter { $0.completed }.count
50+
button.title = "☑️\(completedCount)/\(totalCount)"
4951
}
5052

5153
private func updateStatsItemMenu() {

0 commit comments

Comments
 (0)