mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 03:48:27 +00:00
Update iconography visible in launch video (#1762)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
import WysiwygComposer
|
||||
|
||||
@@ -82,6 +83,7 @@ struct ComposerToolbar: View {
|
||||
.frame(width: closeRTEButtonSize, height: closeRTEButtonSize)
|
||||
.padding(7)
|
||||
}
|
||||
.accessibilityLabel(L10n.actionClose)
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.composerToolbar.closeFormattingOptions)
|
||||
}
|
||||
|
||||
@@ -152,12 +154,11 @@ struct ComposerToolbar: View {
|
||||
private var submitButtonImage: some View {
|
||||
// ZStack with opacity so the button size is consistent.
|
||||
ZStack {
|
||||
Image(systemName: "checkmark")
|
||||
CompoundIcon(\.check)
|
||||
.opacity(context.viewState.composerMode.isEdit ? 1 : 0)
|
||||
.fontWeight(.medium)
|
||||
.accessibilityLabel(L10n.actionConfirm)
|
||||
.accessibilityHidden(!context.viewState.composerMode.isEdit)
|
||||
Image(asset: Asset.Images.timelineComposerSendMessage)
|
||||
Image(asset: Asset.Images.sendMessage)
|
||||
.resizable()
|
||||
.frame(width: sendButtonIconSize, height: sendButtonIconSize)
|
||||
.padding(EdgeInsets(top: 10, leading: 11, bottom: 10, trailing: 9))
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
import WysiwygComposer
|
||||
|
||||
@@ -132,11 +133,11 @@ private struct MessageComposerReplyHeader: View {
|
||||
.cornerRadius(13.0)
|
||||
.overlay(alignment: .topTrailing) {
|
||||
Button(action: action) {
|
||||
Image(systemName: "xmark")
|
||||
.font(.compound.bodySM.weight(.medium))
|
||||
CompoundIcon(\.close, size: .small, relativeTo: .compound.bodySMSemibold)
|
||||
.foregroundColor(.compound.iconTertiary)
|
||||
.padding(8.0)
|
||||
.padding(4.0)
|
||||
}
|
||||
.accessibilityLabel(L10n.actionClose)
|
||||
}
|
||||
.padding(.vertical, 8.0)
|
||||
.padding(.horizontal, -4.0)
|
||||
@@ -148,26 +149,29 @@ private struct MessageComposerEditHeader: View {
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center) {
|
||||
Label(L10n.commonEditing, systemImage: "pencil.line")
|
||||
Label(L10n.commonEditing,
|
||||
iconAsset: Asset.Images.editing,
|
||||
iconSize: .xSmall,
|
||||
relativeTo: .compound.bodySMSemibold)
|
||||
.labelStyle(MessageComposerHeaderLabelStyle())
|
||||
Spacer()
|
||||
Button(action: action) {
|
||||
Image(systemName: "xmark")
|
||||
.font(.compound.bodySM.weight(.medium))
|
||||
CompoundIcon(\.close, size: .small, relativeTo: .compound.bodySMSemibold)
|
||||
.foregroundColor(.compound.iconTertiary)
|
||||
.padding(EdgeInsets(top: 10, leading: 12, bottom: 12, trailing: 14))
|
||||
.padding([.leading, .vertical], 6.0)
|
||||
}
|
||||
.accessibilityLabel(L10n.actionClose)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct MessageComposerHeaderLabelStyle: LabelStyle {
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 5) {
|
||||
HStack(alignment: .center, spacing: 4) {
|
||||
configuration.icon
|
||||
configuration.title
|
||||
}
|
||||
.font(.compound.bodySM)
|
||||
.font(.compound.bodySMSemibold)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
.lineLimit(1)
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
import WysiwygComposer
|
||||
|
||||
@@ -35,6 +36,7 @@ struct RoomAttachmentPicker: View {
|
||||
.foregroundColor(.compound.textActionPrimary)
|
||||
.padding(7)
|
||||
}
|
||||
.accessibilityLabel(L10n.actionAddToTimeline)
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.composerToolbar.openComposeOptions)
|
||||
.popover(isPresented: $context.showAttachmentPopover) {
|
||||
VStack(alignment: .leading, spacing: 0.0) {
|
||||
@@ -42,7 +44,8 @@ struct RoomAttachmentPicker: View {
|
||||
context.showAttachmentPopover = false
|
||||
context.send(viewAction: .displayMediaPicker)
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceGallery, icon: Image(systemName: "photo.fill"))
|
||||
Label(L10n.screenRoomAttachmentSourceGallery, iconAsset: Asset.Images.photosLibrary)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
|
||||
|
||||
@@ -50,7 +53,8 @@ struct RoomAttachmentPicker: View {
|
||||
context.showAttachmentPopover = false
|
||||
context.send(viewAction: .displayDocumentPicker)
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceFiles, icon: Image(systemName: "paperclip"))
|
||||
Label(L10n.screenRoomAttachmentSourceFiles, iconAsset: Asset.Images.attachment)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerDocuments)
|
||||
|
||||
@@ -58,7 +62,8 @@ struct RoomAttachmentPicker: View {
|
||||
context.showAttachmentPopover = false
|
||||
context.send(viewAction: .displayCameraPicker)
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceCamera, icon: Image(systemName: "camera.fill"))
|
||||
Label(L10n.screenRoomAttachmentSourceCamera, iconAsset: Asset.Images.takePhoto)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerCamera)
|
||||
|
||||
@@ -66,7 +71,8 @@ struct RoomAttachmentPicker: View {
|
||||
context.showAttachmentPopover = false
|
||||
context.send(viewAction: .displayLocationPicker)
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourceLocation, icon: Image(asset: Asset.Images.locationPin))
|
||||
Label(L10n.screenRoomAttachmentSourceLocation, iconAsset: Asset.Images.addLocation)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerLocation)
|
||||
|
||||
@@ -74,7 +80,8 @@ struct RoomAttachmentPicker: View {
|
||||
context.showAttachmentPopover = false
|
||||
context.send(viewAction: .displayPollForm)
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentSourcePoll, icon: Image(asset: Asset.Images.timelinePollAttachment))
|
||||
Label(L10n.screenRoomAttachmentSourcePoll, icon: \.polls)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPoll)
|
||||
|
||||
@@ -83,7 +90,8 @@ struct RoomAttachmentPicker: View {
|
||||
context.showAttachmentPopover = false
|
||||
context.send(viewAction: .enableTextFormatting)
|
||||
} label: {
|
||||
PickerLabel(title: L10n.screenRoomAttachmentTextFormatting, icon: Image(asset: Asset.Images.textFormat))
|
||||
Label(L10n.screenRoomAttachmentTextFormatting, iconAsset: Asset.Images.textFormat)
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
|
||||
}
|
||||
@@ -104,30 +112,6 @@ struct RoomAttachmentPicker: View {
|
||||
.presentationDragIndicator(.visible)
|
||||
}
|
||||
}
|
||||
|
||||
private struct PickerLabel: View {
|
||||
let title: String
|
||||
let icon: Image
|
||||
|
||||
init(title: String, icon: Image) {
|
||||
self.title = title
|
||||
self.icon = icon
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Label {
|
||||
Text(title)
|
||||
} icon: {
|
||||
icon
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
}
|
||||
.labelStyle(FixedIconSizeLabelStyle(iconSize: 20))
|
||||
.multilineTextAlignment(.leading)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(16)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct RoomAttachmentPicker_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
@@ -141,11 +141,11 @@ private struct CreatePollOptionView: View {
|
||||
if editMode?.wrappedValue == .active {
|
||||
Button(action: deleteAction) {
|
||||
CompoundIcon(\.delete)
|
||||
.font(.system(size: 24))
|
||||
.foregroundColor(.compound.iconCriticalPrimary)
|
||||
}
|
||||
.disabled(!canDeleteItem)
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
.accessibilityLabel(L10n.actionRemove)
|
||||
}
|
||||
TextField(text: $text) {
|
||||
Text(placeholder)
|
||||
|
||||
@@ -261,9 +261,9 @@ struct HomeScreen: View {
|
||||
Button {
|
||||
context.send(viewAction: .startChat)
|
||||
} label: {
|
||||
Image(systemName: "square.and.pencil")
|
||||
.fontWeight(.semibold)
|
||||
CompoundIcon(customImage: Asset.Images.compose.swiftUIImage)
|
||||
}
|
||||
.accessibilityLabel(L10n.actionStartChat)
|
||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.startChat)
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ struct HomeScreenEmptyStateView: View {
|
||||
.padding(.bottom, 12)
|
||||
|
||||
Button { context.send(viewAction: .startChat) } label: {
|
||||
Label(L10n.actionStartChat, systemImage: "square.and.pencil")
|
||||
Label(L10n.actionStartChat, iconAsset: Asset.Images.compose)
|
||||
.font(.compound.bodyLGSemibold)
|
||||
.foregroundColor(.compound.textOnSolidPrimary)
|
||||
.padding(.vertical, 6)
|
||||
|
||||
@@ -143,12 +143,10 @@ struct HomeScreenRoomCell: View {
|
||||
case .none, .allMessages:
|
||||
EmptyView()
|
||||
case .mentionsAndKeywordsOnly:
|
||||
CompoundIcon(\.mention)
|
||||
.font(.system(size: 15))
|
||||
CompoundIcon(\.mention, size: .custom(15), relativeTo: .compound.bodyMD)
|
||||
.accessibilityLabel(L10n.a11yNotificationsMentionsOnly)
|
||||
case .mute:
|
||||
CompoundIcon(\.notificationsSolidOff)
|
||||
.font(.system(size: 15))
|
||||
CompoundIcon(\.notificationsSolidOff, size: .custom(15), relativeTo: .compound.bodyMD)
|
||||
.accessibilityLabel(L10n.a11yNotificationsMuted)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ struct ThreadDecorator: View {
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
.font(.compound.bodyXS)
|
||||
} icon: {
|
||||
CompoundIcon(\.threads)
|
||||
.font(.system(size: 16))
|
||||
CompoundIcon(\.threads, size: .xSmall, relativeTo: .compound.bodyXS)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
}
|
||||
.labelStyle(.custom(spacing: 4))
|
||||
|
||||
@@ -209,7 +209,7 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
}
|
||||
|
||||
if timelineItem.hasFailedToSend {
|
||||
Image(systemName: "exclamationmark.circle.fill")
|
||||
CompoundIcon(\.error, size: .xSmall, relativeTo: .compound.bodyXS)
|
||||
}
|
||||
}
|
||||
.font(.compound.bodyXS)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct TimelineItemStatusView: View {
|
||||
@@ -50,12 +51,10 @@ struct TimelineItemStatusView: View {
|
||||
TimelineDeliveryStatusView(deliveryStatus: .sent)
|
||||
}
|
||||
case .sendingFailed:
|
||||
// The bubbles handle the failure internally
|
||||
// Bubbles handle the failure internally, but plain items don't.
|
||||
if style == .plain {
|
||||
Image(systemName: "exclamationmark.circle.fill")
|
||||
.resizable()
|
||||
CompoundIcon(\.error, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||
.foregroundColor(.compound.iconCriticalPrimary)
|
||||
.frame(width: 16, height: 16)
|
||||
.onTapGesture {
|
||||
context.sendFailedConfirmationDialogInfo = .init(itemID: timelineItem.id)
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ struct TimelineReactionAddMoreButtonLabel: View {
|
||||
|
||||
var body: some View {
|
||||
TimelineReactionButtonLabel {
|
||||
Image(asset: Asset.Images.timelineReactionAddMore)
|
||||
Image(asset: Asset.Images.addReaction)
|
||||
.resizable()
|
||||
.frame(width: addMoreButtonIconSize, height: addMoreButtonIconSize)
|
||||
// Vertical sizing is done by the layout so that the add more button
|
||||
|
||||
+3
-2
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
/// The item shown when all previous items are un-decryptable due to
|
||||
@@ -27,7 +28,7 @@ struct EncryptedHistoryRoomTimelineView: View {
|
||||
.font(.compound.bodyMDSemibold)
|
||||
.foregroundColor(.compound.textInfoPrimary)
|
||||
} icon: {
|
||||
Image(systemName: "info.circle.fill")
|
||||
CompoundIcon(\.info, size: .small, relativeTo: .compound.bodyMDSemibold)
|
||||
.foregroundColor(.compound.iconInfoPrimary)
|
||||
}
|
||||
.labelStyle(EncryptedHistoryLabelStyle())
|
||||
@@ -46,7 +47,7 @@ struct EncryptedHistoryRoomTimelineView: View {
|
||||
|
||||
private struct EncryptedHistoryLabelStyle: LabelStyle {
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 16) {
|
||||
HStack(alignment: .top, spacing: 16) {
|
||||
configuration.icon
|
||||
configuration.title
|
||||
}
|
||||
|
||||
@@ -21,8 +21,9 @@ struct EncryptedRoomTimelineView: View {
|
||||
|
||||
var body: some View {
|
||||
TimelineStyler(timelineItem: timelineItem) {
|
||||
Label(timelineItem.body, systemImage: "lock.shield")
|
||||
Label(timelineItem.body, iconAsset: Asset.Images.decryptionError, iconSize: .small, relativeTo: .compound.bodyLG)
|
||||
.labelStyle(RoomTimelineViewLabelStyle())
|
||||
.font(.compound.bodyLG)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,11 +32,10 @@ struct RoomTimelineViewLabelStyle: LabelStyle {
|
||||
@Environment(\.timelineStyle) private var timelineStyle
|
||||
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 8) {
|
||||
HStack(alignment: .center, spacing: 8) {
|
||||
configuration.icon
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
configuration.title
|
||||
.font(.body)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
}
|
||||
.padding(.horizontal, timelineStyle == .bubbles ? 4 : 0)
|
||||
@@ -63,6 +63,11 @@ struct EncryptedRoomTimelineView_Previews: PreviewProvider, TestablePreview {
|
||||
timestamp: "Later",
|
||||
isOutgoing: true,
|
||||
senderId: "Anne"))
|
||||
|
||||
EncryptedRoomTimelineView(timelineItem: itemWith(text: "Some other text that is very long and will wrap onto multiple lines.",
|
||||
timestamp: "Later",
|
||||
isOutgoing: true,
|
||||
senderId: "Anne"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,27 +101,27 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
|
||||
var label: some View {
|
||||
switch self {
|
||||
case .copy:
|
||||
Label(L10n.actionCopy, systemImage: "doc.on.doc")
|
||||
Label(L10n.actionCopy, iconAsset: Asset.Images.copy)
|
||||
case .edit:
|
||||
Label(L10n.actionEdit, systemImage: "pencil.line")
|
||||
Label(L10n.actionEdit, iconAsset: Asset.Images.editOutline)
|
||||
case .copyPermalink:
|
||||
Label(L10n.actionCopyLinkToMessage, systemImage: "link")
|
||||
Label(L10n.actionCopyLinkToMessage, icon: \.link)
|
||||
case .reply(let isThread):
|
||||
Label(isThread ? L10n.actionReplyInThread : L10n.actionReply, systemImage: "arrowshape.turn.up.left")
|
||||
Label(isThread ? L10n.actionReplyInThread : L10n.actionReply, iconAsset: Asset.Images.reply)
|
||||
case .forward:
|
||||
Label(L10n.actionForward, systemImage: "arrowshape.turn.up.right")
|
||||
Label(L10n.actionForward, iconAsset: Asset.Images.forward)
|
||||
case .redact:
|
||||
Label(L10n.actionRemove, systemImage: "trash")
|
||||
Label(L10n.actionRemove, icon: \.delete)
|
||||
case .viewSource:
|
||||
Label(L10n.actionViewSource, systemImage: "doc.text.below.ecg")
|
||||
Label(L10n.actionViewSource, iconAsset: Asset.Images.viewSource)
|
||||
case .retryDecryption:
|
||||
Label(L10n.actionRetryDecryption, systemImage: "arrow.down.message")
|
||||
case .report:
|
||||
Label(L10n.actionReportContent, systemImage: "exclamationmark.bubble")
|
||||
Label(L10n.actionReportContent, icon: \.chatProblem)
|
||||
case .react:
|
||||
Label(L10n.actionReact, systemImage: "hand.thumbsup")
|
||||
Label(L10n.actionReact, iconAsset: Asset.Images.addReaction)
|
||||
case .endPoll:
|
||||
Label { Text(L10n.actionEndPoll) } icon: { CompoundIcon(customImage: Asset.Images.endedPoll.swiftUIImage) }
|
||||
Label(L10n.actionEndPoll, iconAsset: Asset.Images.endedPoll)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,13 +227,14 @@ public struct TimelineItemMenu: View {
|
||||
context.send(viewAction: .displayEmojiPicker(itemID: item.id))
|
||||
}
|
||||
} label: {
|
||||
Image(asset: Asset.Images.timelineReactionAddMore)
|
||||
Image(asset: Asset.Images.addReaction)
|
||||
.resizable()
|
||||
.frame(width: addMoreButtonIconSize, height: addMoreButtonIconSize)
|
||||
.frame(maxHeight: .infinity, alignment: .center)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.padding(10)
|
||||
}
|
||||
.accessibilityLabel(L10n.actionReact)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
@@ -269,10 +270,7 @@ public struct TimelineItemMenu: View {
|
||||
send(action)
|
||||
} label: {
|
||||
action.label
|
||||
.labelStyle(FixedIconSizeLabelStyle())
|
||||
.multilineTextAlignment(.leading)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding()
|
||||
.labelStyle(.menuSheet)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ struct SettingsScreen: View {
|
||||
Spacer()
|
||||
|
||||
CompoundIcon(\.chevronRight)
|
||||
.font(.system(size: 24))
|
||||
.foregroundColor(.compound.iconTertiaryAlpha)
|
||||
.flipsForRightToLeftLayoutDirection(true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user