Skip to content

Commit

Permalink
Always draw a shadow around the Ice Bar
Browse files Browse the repository at this point in the history
Closes #469
  • Loading branch information
jordanbaird committed Jan 22, 2025
1 parent c277712 commit 7e736a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Ice/UI/IceBar/IceBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private struct IceBarContentView: View {
screen.hasNotch ? 0 : 2
}

var contentHeight: CGFloat? {
private var contentHeight: CGFloat? {
guard let menuBarHeight = imageCache.menuBarHeight ?? screen.getMenuBarHeight() else {
return nil
}
Expand All @@ -278,6 +278,10 @@ private struct IceBarContentView: View {
}
}

private var shadowOpacity: CGFloat {
configuration.current.hasShadow ? 0.5 : 0.33
}

var body: some View {
ZStack {
content
Expand All @@ -287,7 +291,7 @@ private struct IceBarContentView: View {
.layoutBarStyle(appState: appState, averageColorInfo: colorManager.colorInfo)
.foregroundStyle(colorManager.colorInfo?.color.brightness ?? 0 > 0.67 ? .black : .white)
.clipShape(clipShape)
.shadow(color: .black.opacity(configuration.current.hasShadow ? 0.5 : 0), radius: 2.5)
.shadow(color: .black.opacity(shadowOpacity), radius: 2.5)

if configuration.current.hasBorder {
clipShape
Expand Down

0 comments on commit 7e736a0

Please sign in to comment.