Activity Theme Adjustment
Nucleic-Session: 5F808220-F280-49B7-8876-41EE93E714FA Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -78,12 +78,17 @@ private struct LockScreenView: View {
|
|||||||
let hostName: String
|
let hostName: String
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
let attention = state.needsAttention
|
||||||
// Header: brand + host, and the headline counts.
|
let tint = ActivityPalette.attentionTint(state)
|
||||||
|
return VStack(alignment: .leading, spacing: 8) {
|
||||||
|
// Header: brand + host, and the headline counts. When the user is needed the brand
|
||||||
|
// mark becomes the attention glyph in its tint, so the header itself reads "act now".
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
Image(systemName: "hexagon.fill")
|
Image(systemName: attention
|
||||||
|
? ActivityPalette.glyph(state.approvalCount > 0 ? .approval : .needsInput)
|
||||||
|
: "hexagon.fill")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundStyle(ActivityPalette.active)
|
.foregroundStyle(attention ? tint : ActivityPalette.active)
|
||||||
Text(hostName)
|
Text(hostName)
|
||||||
.font(.caption.weight(.semibold))
|
.font(.caption.weight(.semibold))
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
@@ -98,6 +103,20 @@ private struct LockScreenView: View {
|
|||||||
}
|
}
|
||||||
.padding(14)
|
.padding(14)
|
||||||
.foregroundStyle(.white)
|
.foregroundStyle(.white)
|
||||||
|
// Attention theme: a soft tinted wash + a colored border around the whole glance, so a
|
||||||
|
// session waiting on the user is unmistakable at a glance even before reading the rows.
|
||||||
|
.background {
|
||||||
|
if attention {
|
||||||
|
RoundedRectangle(cornerRadius: 22, style: .continuous)
|
||||||
|
.fill(tint.opacity(0.12))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.overlay {
|
||||||
|
if attention {
|
||||||
|
RoundedRectangle(cornerRadius: 22, style: .continuous)
|
||||||
|
.strokeBorder(tint.opacity(0.9), lineWidth: 2)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user