mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user