listless

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

commit 3a132ca673c4704c059d0e929a7ced3264f17684
parent 7afa7ce1240112fe52d9038d582b9f8baba941db
Author: Michael Camilleri <[email protected]>
Date:   Sat,  7 Mar 2026 17:28:29 +0900

Tweak colours in the watchOS app

This commit uses the accent colour along the top of the task row.

Co-Authored-By: Claude 4.6 Opus <[email protected]>

Diffstat:
MListlessWatch/ListlessWatchApp.swift | 8++++++++
MListlessWatch/Views/TaskListView.swift | 4+++-
MListlessWatch/Views/TaskRowView.swift | 16+++++++++++++++-
3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/ListlessWatch/ListlessWatchApp.swift b/ListlessWatch/ListlessWatchApp.swift @@ -4,6 +4,14 @@ import SwiftUI struct ListlessWatchApp: App { private let persistenceController = PersistenceController.shared + init() { + let kvStore = NSUbiquitousKeyValueStore.default + kvStore.synchronize() + if let heading = kvStore.string(forKey: "headingText") { + UserDefaults.standard.set(heading, forKey: "headingText") + } + } + var body: some Scene { WindowGroup { TaskListView( diff --git a/ListlessWatch/Views/TaskListView.swift b/ListlessWatch/Views/TaskListView.swift @@ -5,6 +5,8 @@ struct TaskListView: View { let store: TaskStore let syncMonitor: CloudKitSyncMonitor + @AppStorage("headingText") private var headingText = "Items" + @FetchRequest( sortDescriptors: [ SortDescriptor(\TaskItem.isCompleted, order: .forward), @@ -52,7 +54,7 @@ struct TaskListView: View { } } } - .navigationTitle("Listless") + .navigationTitle(headingText) } } diff --git a/ListlessWatch/Views/TaskRowView.swift b/ListlessWatch/Views/TaskRowView.swift @@ -12,7 +12,7 @@ struct TaskRowView: View { } label: { HStack(spacing: 8) { Image(systemName: task.isCompleted ? "checkmark.circle.fill" : "circle") - .foregroundStyle( + .foregroundColor( task.isCompleted ? .secondary : cachedTaskColor(forIndex: index, total: totalActive) @@ -24,7 +24,21 @@ struct TaskRowView: View { .foregroundStyle(task.isCompleted ? .secondary : .primary) .lineLimit(3) } + .padding(.vertical, 4) } + .listRowBackground( + task.isCompleted + ? AnyView(Color(white: 0.15) + .clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))) + : AnyView( + ZStack(alignment: .top) { + Color(white: 0.15) + cachedTaskColor(forIndex: index, total: totalActive) + .frame(height: 3) + } + .clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous)) + ) + ) .buttonStyle(.plain) } }