mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Media browser tweaks (#3692)
* Move the media actions from the bottom bar into the details sheet. * Allow the media type picker to fill the width of the screen.
This commit is contained in:
+22
-13
@@ -19,19 +19,7 @@ struct MediaEventsTimelineScreen: View {
|
||||
.background(.compound.bgCanvasDefault)
|
||||
// Doesn't play well with the transformed scrollView
|
||||
.toolbarBackground(.visible, for: .navigationBar)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .principal) {
|
||||
Picker("", selection: $context.screenMode) {
|
||||
Text(L10n.screenMediaBrowserListModeMedia)
|
||||
.padding()
|
||||
.tag(MediaEventsTimelineScreenMode.media)
|
||||
Text(L10n.screenMediaBrowserListModeFiles)
|
||||
.padding()
|
||||
.tag(MediaEventsTimelineScreenMode.files)
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
}
|
||||
}
|
||||
.toolbar { toolbar }
|
||||
.environmentObject(context.viewState.activeTimelineContextProvider())
|
||||
.environment(\.timelineContext, context.viewState.activeTimelineContextProvider())
|
||||
.onChange(of: context.screenMode) { _, _ in
|
||||
@@ -206,6 +194,27 @@ struct MediaEventsTimelineScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .principal) {
|
||||
Picker("", selection: $context.screenMode) {
|
||||
Text(L10n.screenMediaBrowserListModeMedia)
|
||||
.padding()
|
||||
.tag(MediaEventsTimelineScreenMode.media)
|
||||
Text(L10n.screenMediaBrowserListModeFiles)
|
||||
.padding()
|
||||
.tag(MediaEventsTimelineScreenMode.files)
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
.frame(idealWidth: .greatestFiniteMagnitude)
|
||||
}
|
||||
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
// Reserve the space trailing space to match the back button.
|
||||
CompoundIcon(\.search).hidden()
|
||||
}
|
||||
}
|
||||
|
||||
func tappedItem(_ item: RoomTimelineItemViewState) {
|
||||
context.send(viewAction: .tappedItem(item: item, namespace: zoomTransition))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user