listless

A simple list app for Apple platforms
Log | Files | Refs | README | LICENSE

commit 548dd3180490b2c7154f42c578c5cad44883943e
parent 9fb8e85d42f9229c63a33d19820165d9308a568b
Author: Michael Camilleri <[email protected]>
Date:   Thu,  5 Mar 2026 10:06:27 +0900

Use accent colour for selected active tasks on macOS

Diffstat:
MListlessMac/Views/TaskRowView.swift | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/ListlessMac/Views/TaskRowView.swift b/ListlessMac/Views/TaskRowView.swift @@ -136,6 +136,12 @@ struct TaskRowView: View { .padding(.leading, dividerInset) } } + .overlay { + if isSelected && !task.isCompleted { + RoundedRectangle(cornerRadius: 6, style: .continuous) + .stroke(cachedAccentColor.opacity(0.40), lineWidth: 2) + } + } .contextMenu { Button(task.isCompleted ? "Mark as Incomplete" : "Mark as Complete") { onToggle(task) @@ -176,11 +182,11 @@ struct TaskRowView: View { @ViewBuilder private var selectionBackground: some View { - if isSelected { + if task.isCompleted { + isSelected ? Color(nsColor: .controlBackgroundColor) : Color(nsColor: .windowBackgroundColor) + } else if isSelected { RoundedRectangle(cornerRadius: 6, style: .continuous) - .fill(Color.accentColor.opacity(0.2)) - } else if task.isCompleted { - Color(nsColor: .windowBackgroundColor) + .fill(cachedAccentColor.opacity(0.10)) } }