Skip to content

Commit

Permalink
Change styling
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzanowskim committed Jan 27, 2024
1 parent ea6beca commit 98cac5f
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions DemoApp/View/AnnotationLabelView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,29 @@ struct AnnotationLabelView : View {
Image(systemName: "xmark.octagon")
.foregroundStyle(.white)
}
.shadow(radius: 1)
.shadow(color: annotation.kind.color, radius: 1)
}
.buttonStyle(.plain)
}
.labelStyle(
AnnotationLabelStyle()
)
.background(
annotation.kind.color.background(Color.white)
ZStack {
ContainerRelativeShape()
.fill(annotation.kind.color)
.background(.background)

ContainerRelativeShape()
.stroke(annotation.kind.color)
}
)
.containerShape(
UnevenRoundedRectangle(
cornerRadii: RectangleCornerRadii(topLeading: 2, bottomLeading: 2),
style: .circular
)
)
.clipShape(UnevenRoundedRectangle(cornerRadii: RectangleCornerRadii(topLeading: 2, bottomLeading: 2), style: .circular))
.labelStyle(AnnotationLabelStyle())
.shadow(radius: 1, x: 0.3, y: 0.5)
}
}

Expand All @@ -62,9 +75,10 @@ private struct AnnotationLabelStyle: LabelStyle {
.contentShape(Rectangle())

Rectangle()
.foregroundColor(.white)
.foregroundStyle(.background)
.frame(width: 1)
.frame(maxHeight: .infinity)
.padding(.vertical, 0.5)

configuration.title
.padding(.leading, 4)
Expand Down

0 comments on commit 98cac5f

Please sign in to comment.