Skip to content

Commit 35159d4

Browse files
committed
feat: add liquid glass folder count badges
1 parent bcb4df7 commit 35159d4

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

‎EdgeMark/UI/Navigation/HomeFolderView.swift‎

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,12 +883,7 @@ struct FolderRowView: View {
883883
.foregroundStyle(color?.color ?? Color.accentColor)
884884

885885
if count > 0 {
886-
Text("\(count)")
887-
.font(.system(size: 9, weight: .semibold, design: .rounded))
888-
.foregroundStyle(.background)
889-
.padding(.horizontal, 3)
890-
.padding(.vertical, 0.5)
891-
.background(.primary.opacity(0.8), in: Capsule())
886+
FolderCountBadge(count: count)
892887
.offset(x: 4, y: -3)
893888
}
894889
}
@@ -923,6 +918,32 @@ struct FolderRowView: View {
923918
}
924919
}
925920

921+
/// Compact folder count that follows the selected panel appearance.
922+
private struct FolderCountBadge: View {
923+
@Environment(AppSettings.self) private var appSettings
924+
925+
let count: Int
926+
927+
var body: some View {
928+
if #available(macOS 26.0, *), appSettings.usesLiquidGlass {
929+
label
930+
.foregroundStyle(.primary)
931+
.glassEffect(.regular, in: Capsule())
932+
} else {
933+
label
934+
.foregroundStyle(.background)
935+
.background(.primary.opacity(0.8), in: Capsule())
936+
}
937+
}
938+
939+
private var label: some View {
940+
Text("\(count)")
941+
.font(.system(size: 9, weight: .semibold, design: .rounded))
942+
.padding(.horizontal, 3)
943+
.padding(.vertical, 0.5)
944+
}
945+
}
946+
926947
// MARK: - Note Row View
927948

928949
/// Note row with hover highlight animation and preview line. Tap gestures are

0 commit comments

Comments
 (0)