← All repositories

crossmate

A collaborative crossword app for iPhone and iPad

git clone https://code.inqk.net/crossmate.git


commit e27c5b5001169bab53a38f70ef51215f3994f6e1
parent aeb3e878ffca33755491e42f6fdfce6d7b5d697d
Author: Michael Camilleri <[email protected]>
Date:   Sat,  9 May 2026 14:09:34 +0900

Disable solved puzzle toolbar actions

Completed puzzles should leave the toolbar in a read-only state. This commit
disables the Players menu alongside the existing Entry and Hints controls, and
makes the Draft button drop its active styling when solved.

Co-Authored-By: Codex GPT 5.5 <[email protected]>

Diffstat

MCrossmate/Views/PuzzleView.swift | 12++++++++++--

1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Crossmate/Views/PuzzleView.swift b/Crossmate/Views/PuzzleView.swift

@@ -669,10 +669,10 @@ private struct PuzzleToolbarModifier: ViewModifier {
             session.togglePencil()
         } label: {
             Image(systemName: "pencil")
-                .foregroundStyle(session.isPencilMode ? Color.white : Color.primary)
+                .foregroundStyle(pencilButtonForeground)
                 .padding(6)
                 .glassEffect(
-                    session.isPencilMode
+                    !isSolved && session.isPencilMode
                         ? .regular.tint(preferences.color.tint)
                         : .identity,
                     in: Circle()
@@ -682,6 +682,13 @@ private struct PuzzleToolbarModifier: ViewModifier {
         .disabled(isSolved)
     }
 
+    private var pencilButtonForeground: Color {
+        if isSolved {
+            return .secondary
+        }
+        return session.isPencilMode ? .white : .primary
+    }
+
     private var entryMenu: some View {
         Menu {
             Section {
@@ -726,6 +733,7 @@ private struct PuzzleToolbarModifier: ViewModifier {
         } label: {
             Label("Players", systemImage: "person.2")
         }
+        .disabled(isSolved)
     }
 
     @ViewBuilder