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:
Doug
2025-01-21 17:00:04 +00:00
committed by GitHub
parent 55e399aaf7
commit 909ee4abf2
43 changed files with 203 additions and 160 deletions
@@ -74,6 +74,8 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
case pin
case unpin
case viewInRoomTimeline
case share
case save
var id: Self { self }
@@ -128,7 +130,7 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
var canAppearInMediaDetails: Bool {
switch self {
case .viewInRoomTimeline, .redact:
case .viewInRoomTimeline, .share, .save, .redact:
true
default:
false
@@ -178,6 +180,10 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
Label(L10n.actionUnpin, icon: \.unpin)
case .viewInRoomTimeline:
Label(L10n.actionViewInTimeline, icon: \.visibilityOn)
case .share:
Label(L10n.actionShare, icon: \.shareIos)
case .save:
Label(L10n.actionSave, icon: \.downloadIos)
}
}
}
@@ -107,6 +107,8 @@ struct TimelineItemMenuActionProvider {
actions = actions.filter(\.canAppearInPinnedEventsTimeline)
secondaryActions = secondaryActions.filter(\.canAppearInPinnedEventsTimeline)
case .media:
actions.append(.share)
actions.append(.save)
actions = actions.filter(\.canAppearInMediaDetails)
secondaryActions = secondaryActions.filter(\.canAppearInMediaDetails)
case .live, .detached: