@@ -23,7 +23,6 @@ struct NotificationOverlayView: View {
2323
2424 @State private var hasOverflow : Bool = false
2525 @State private var contentHeight : CGFloat = 0.0
26- @State private var scrollOffset : CGFloat = 0
2726
2827 private func updateOverflow( contentHeight: CGFloat , containerHeight: CGFloat ) {
2928 if !hasOverflow && contentHeight > containerHeight {
@@ -33,12 +32,12 @@ struct NotificationOverlayView: View {
3332 }
3433 }
3534
36- var notifications : some View {
35+ @ ViewBuilder var notifications : some View {
3736 let visibleNotifications = workspace. notificationOverlay. activeNotifications. filter {
3837 workspace. notificationOverlay. isNotificationVisible ( $0)
3938 }
4039
41- return VStack ( spacing: 8 ) {
40+ VStack ( spacing: 8 ) {
4241 ForEach ( visibleNotifications, id: \. id) { notification in
4342 NotificationBannerView (
4443 notification: notification,
@@ -59,7 +58,7 @@ struct NotificationOverlayView: View {
5958 . animation ( . easeInOut( duration: 0.3 ) , value: visibleNotifications)
6059 }
6160
62- var notificationsWithScrollView : some View {
61+ @ ViewBuilder var notificationsWithScrollView : some View {
6362 GeometryReader { geometry in
6463 HStack {
6564 Spacer ( )
@@ -161,10 +160,3 @@ struct NotificationOverlayView: View {
161160 . animation ( . easeInOut( duration: 0.2 ) , value: controlActiveState)
162161 }
163162}
164-
165- struct ScrollOffsetPreferenceKey : PreferenceKey {
166- static var defaultValue : CGFloat = 0
167- static func reduce( value: inout CGFloat , nextValue: ( ) -> CGFloat ) {
168- value = nextValue ( )
169- }
170- }
0 commit comments