mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 03:48:27 +00:00
Use the editor toolbar role on iOS 26 instead of left aligning the header by frame. (#4647)
The weird back button animation doesn't happen anymore 🥳
This commit is contained in:
@@ -40,6 +40,7 @@ struct JoinRoomScreen: View {
|
||||
.alert(item: $context.alertInfo)
|
||||
.background()
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.toolbarRole(RoomHeaderView.toolbarRole)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar { toolbar }
|
||||
.shouldScrollOnKeyboardDidShow(focus == .knockMessage, to: Focus.knockMessage)
|
||||
|
||||
@@ -66,6 +66,7 @@ struct RoomScreen: View {
|
||||
.environment(\.shouldAutomaticallyLoadImages, !timelineContext.viewState.hideTimelineMedia)
|
||||
}
|
||||
}
|
||||
.toolbarRole(RoomHeaderView.toolbarRole)
|
||||
.navigationTitle(L10n.screenRoomTitle) // Hidden but used for back button text.
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar { toolbar }
|
||||
|
||||
@@ -21,6 +21,7 @@ struct SpaceScreen: View {
|
||||
}
|
||||
}
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.toolbarRole(RoomHeaderView.toolbarRole)
|
||||
.navigationTitle(context.viewState.space.name)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar { toolbar }
|
||||
|
||||
@@ -24,10 +24,11 @@ struct ThreadTimelineScreen: View {
|
||||
|
||||
var body: some View {
|
||||
TimelineView(timelineContext: timelineContext)
|
||||
.background(.compound.bgCanvasDefault)
|
||||
.toolbarRole(RoomHeaderView.toolbarRole)
|
||||
.navigationTitle(L10n.commonThread)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar { toolbar }
|
||||
.background(.compound.bgCanvasDefault)
|
||||
.toolbarBackground(.visible, for: .navigationBar) // Fix the toolbar's background.
|
||||
.timelineMediaPreview(viewModel: $context.mediaPreviewViewModel)
|
||||
.overlay(alignment: .bottomTrailing) {
|
||||
|
||||
Reference in New Issue
Block a user