mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
Add toolbar scrim on channel view for pre-macOS 26
This commit is contained in:
@@ -368,6 +368,11 @@ struct ChannelView: View {
|
|||||||
}
|
}
|
||||||
.background(viewBackgroundColor)
|
.background(viewBackgroundColor)
|
||||||
.ignoresSafeArea(edges: .top)
|
.ignoresSafeArea(edges: .top)
|
||||||
|
#if os(macOS)
|
||||||
|
.overlay(alignment: .top) {
|
||||||
|
legacyToolbarScrim
|
||||||
|
}
|
||||||
|
#endif
|
||||||
.animation(.easeInOut(duration: 0.25), value: isSearchActive)
|
.animation(.easeInOut(duration: 0.25), value: isSearchActive)
|
||||||
.modifier(ChannelScrollOffsetModifier(
|
.modifier(ChannelScrollOffsetModifier(
|
||||||
scrollOffset: $scrollOffset,
|
scrollOffset: $scrollOffset,
|
||||||
@@ -522,6 +527,11 @@ struct ChannelView: View {
|
|||||||
}
|
}
|
||||||
.background(viewBackgroundColor)
|
.background(viewBackgroundColor)
|
||||||
.ignoresSafeArea(edges: .top)
|
.ignoresSafeArea(edges: .top)
|
||||||
|
#if os(macOS)
|
||||||
|
.overlay(alignment: .top) {
|
||||||
|
legacyToolbarScrim
|
||||||
|
}
|
||||||
|
#endif
|
||||||
.toolbar {
|
.toolbar {
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
if supportsChannelTabs {
|
if supportsChannelTabs {
|
||||||
@@ -917,6 +927,28 @@ struct ChannelView: View {
|
|||||||
// MARK: - Header
|
// MARK: - Header
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
|
/// Pre-macOS 26 has no Liquid Glass toolbar capsules, so toolbar items sit
|
||||||
|
/// directly on the banner/scrolled content. A fixed window-background scrim
|
||||||
|
/// at the top keeps them legible in both appearances.
|
||||||
|
@ViewBuilder
|
||||||
|
private var legacyToolbarScrim: some View {
|
||||||
|
if #unavailable(macOS 26) {
|
||||||
|
LinearGradient(
|
||||||
|
stops: [
|
||||||
|
.init(color: Color(nsColor: .windowBackgroundColor).opacity(0.9), location: 0),
|
||||||
|
.init(color: Color(nsColor: .windowBackgroundColor).opacity(0.75), location: 0.5),
|
||||||
|
.init(color: .clear, location: 1)
|
||||||
|
],
|
||||||
|
startPoint: .top,
|
||||||
|
endPoint: .bottom
|
||||||
|
)
|
||||||
|
.frame(height: 100)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.allowsHitTesting(false)
|
||||||
|
.ignoresSafeArea(edges: .top)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private func collapsedToolbarTitle(name: String, thumbnailURL: URL?) -> some View {
|
private func collapsedToolbarTitle(name: String, thumbnailURL: URL?) -> some View {
|
||||||
let label = HStack(spacing: 8) {
|
let label = HStack(spacing: 8) {
|
||||||
|
|||||||
Reference in New Issue
Block a user