diff --git a/swift-paperless/Views/IconTintLabelStyle.swift b/swift-paperless/Views/IconTintLabelStyle.swift new file mode 100644 index 00000000..0ce56dc7 --- /dev/null +++ b/swift-paperless/Views/IconTintLabelStyle.swift @@ -0,0 +1,29 @@ +// +// IconColorLabelStyle.swift +// swift-paperless +// +// Created by Paul Gessinger on 20.01.26. +// + +import SwiftUI + +struct IconTintLabelStyle: LabelStyle { + private let color: Color + + init(_ color: Color) { + self.color = color + } + + func makeBody(configuration: Configuration) -> some View { + Label( + title: { configuration.title }, + icon: { configuration.icon.foregroundStyle(color) } + ) + } +} + +extension LabelStyle where Self == IconTintLabelStyle { + static func iconTint(_ color: Color) -> Self { + IconTintLabelStyle(color) + } +}