mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 20:39:24 +00:00
iOS 26 minor fixes
This commit is contained in:
committed by
Stefan Ceriu
parent
12dc6f42ba
commit
2de50ab036
@@ -6,17 +6,43 @@
|
||||
//
|
||||
|
||||
import Compound
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import SwiftUIIntrospect
|
||||
|
||||
extension View {
|
||||
@ViewBuilder
|
||||
func bloom() -> some View {
|
||||
modifier(BloomModifier())
|
||||
if #available(iOS 26, *) {
|
||||
modifier(BloomModifier())
|
||||
} else {
|
||||
modifier(OldBloomModifier())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct BloomModifier: ViewModifier {
|
||||
@State private var height = CGFloat.zero
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content
|
||||
.onGeometryChange(for: CGFloat.self) { proxy in
|
||||
proxy.safeAreaInsets.top
|
||||
} action: { height in
|
||||
self.height = height
|
||||
}
|
||||
.overlay(alignment: .top) {
|
||||
LinearGradient(gradient: .compound.subtle,
|
||||
startPoint: .top,
|
||||
endPoint: .init(x: 0.5, y: 0.35))
|
||||
.ignoresSafeArea(edges: .all)
|
||||
.frame(height: height)
|
||||
.allowsHitTesting(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct OldBloomModifier: ViewModifier {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
@State private var standardAppearance = UINavigationBarAppearance()
|
||||
|
||||
@@ -34,19 +34,7 @@ struct HomeScreen: View {
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button {
|
||||
context.send(viewAction: .showSettings)
|
||||
} label: {
|
||||
LoadableAvatarImage(url: context.viewState.userAvatarURL,
|
||||
name: context.viewState.userDisplayName,
|
||||
contentID: context.viewState.userID,
|
||||
avatarSize: .user(on: .chats),
|
||||
mediaProvider: context.mediaProvider)
|
||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
|
||||
.overlayBadge(10, isBadged: context.viewState.requiresExtraAccountSetup)
|
||||
.compositingGroup()
|
||||
}
|
||||
.accessibilityLabel(L10n.commonSettings)
|
||||
settingsButton
|
||||
}
|
||||
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
@@ -54,6 +42,23 @@ struct HomeScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var settingsButton: some View {
|
||||
Button {
|
||||
context.send(viewAction: .showSettings)
|
||||
} label: {
|
||||
LoadableAvatarImage(url: context.viewState.userAvatarURL,
|
||||
name: context.viewState.userDisplayName,
|
||||
contentID: context.viewState.userID,
|
||||
avatarSize: .user(on: .chats),
|
||||
mediaProvider: context.mediaProvider)
|
||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
|
||||
.overlayBadge(10, isBadged: context.viewState.requiresExtraAccountSetup)
|
||||
.compositingGroup()
|
||||
.clipShape(.circle)
|
||||
}
|
||||
.accessibilityLabel(L10n.commonSettings)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var newRoomButton: some View {
|
||||
switch context.viewState.roomListMode {
|
||||
|
||||
Reference in New Issue
Block a user