Skip to content

Commit 538ee31

Browse files
committed
Make sure the checkmark is centered
1 parent 435803e commit 538ee31

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

Solid/Editor/ColorInfo/CopyHexButton.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ struct CopyHexButton: View {
1717
isShowingHexCopiedIndicator = false
1818
}
1919
} label: {
20-
Image(
21-
systemName: isShowingHexCopiedIndicator
22-
? "checkmark"
23-
: "square.on.square"
24-
)
25-
.imageScale(.large)
26-
.foregroundColor(isShowingHexCopiedIndicator ? .green : .primary)
20+
Image(systemName: "square.on.square")
21+
.imageScale(.large)
22+
.opacity(isShowingHexCopiedIndicator ? 0 : 1)
23+
.overlay {
24+
Image(systemName: "checkmark")
25+
.imageScale(.large)
26+
.foregroundColor(.green)
27+
.opacity(isShowingHexCopiedIndicator ? 1 : 0)
28+
}
2729
}
2830
.buttonStyle(.solid)
2931
}

0 commit comments

Comments
 (0)