First round of icon updates. (#2076)

Update Compound too.
This commit is contained in:
Doug
2023-11-13 16:44:29 +00:00
committed by GitHub
parent acd079199a
commit 4257c20bc9
84 changed files with 182 additions and 176 deletions
@@ -35,7 +35,7 @@ struct BugReportScreen: View {
.disabled(context.viewState.shouldDisableInteraction)
.scrollDismissesKeyboard(.immediately)
.compoundList()
.navigationTitle(L10n.commonReportABug)
.navigationTitle(L10n.commonReportAProblem)
.navigationBarTitleDisplayMode(.inline)
.toolbar { toolbar }
.interactiveDismissDisabled()
@@ -44,7 +44,7 @@ struct RoomAttachmentPicker: View {
context.showAttachmentPopover = false
context.send(viewAction: .displayMediaPicker)
} label: {
Label(L10n.screenRoomAttachmentSourceGallery, iconAsset: Asset.Images.photosLibrary)
Label(L10n.screenRoomAttachmentSourceGallery, icon: \.image)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
@@ -226,7 +226,7 @@ struct HomeScreen: View {
Button {
context.send(viewAction: .startChat)
} label: {
CompoundIcon(customImage: Asset.Images.compose.swiftUIImage)
CompoundIcon(\.edit)
}
.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, iconAsset: Asset.Images.compose)
Label(L10n.actionStartChat, icon: \.edit)
.font(.compound.bodyLGSemibold)
.foregroundColor(.compound.textOnSolidPrimary)
.padding(.vertical, 6)
@@ -39,13 +39,13 @@ struct HomeScreenRoomList: View {
Button {
context.send(viewAction: .showRoomDetails(roomIdentifier: room.id))
} label: {
Label(L10n.commonSettings, systemImage: "gearshape")
Label(L10n.commonSettings, icon: \.settings)
}
Button(role: .destructive) {
context.send(viewAction: .leaveRoom(roomIdentifier: room.id))
} label: {
Label(L10n.actionLeaveRoom, systemImage: "rectangle.portrait.and.arrow.right")
Label(L10n.actionLeaveRoom, icon: \.leave)
}
}
}
@@ -18,7 +18,7 @@ import Compound
import SwiftUI
struct HomeScreenUserMenuButton: View {
@Environment(\.colorScheme) var colorScheme
@Environment(\.colorScheme) private var colorScheme
@ObservedObject var context: HomeScreenViewModel.Context
@@ -42,19 +42,19 @@ struct HomeScreenUserMenuButton: View {
}
Section {
MatrixUserShareLink(userID: context.viewState.userID) {
Label(L10n.actionInvite, systemImage: "square.and.arrow.up")
Label(L10n.actionInvite, iconAsset: Asset.Images.shareIos)
}
Button {
context.send(viewAction: .userMenu(action: .feedback))
} label: {
Label(L10n.commonReportABug, systemImage: "ladybug")
Label(L10n.commonReportAProblem, icon: \.chatProblem)
}
}
Section {
Button(role: .destructive) {
context.send(viewAction: .userMenu(action: .logout))
} label: {
Label(L10n.screenSignoutPreferenceItem, systemImage: "rectangle.portrait.and.arrow.right")
Label(L10n.screenSignoutPreferenceItem, iconAsset: Asset.Images.signOut)
}
}
} label: {
@@ -122,15 +122,12 @@ struct RoomDetailsEditScreen: View {
}
private var avatarOverlayIcon: some View {
Image(systemName: "camera")
.font(.system(size: 14, weight: .semibold))
.padding(3)
.imageScale(.small)
CompoundIcon(customImage: Asset.Images.editing.swiftUIImage, size: .xSmall, relativeTo: .compound.bodyLG)
.foregroundColor(.white)
.padding(3)
.background {
Circle()
.foregroundColor(.black)
.aspectRatio(1, contentMode: .fill)
}
}
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
enum TimelineReplyViewPlacement {
@@ -43,7 +44,7 @@ struct TimelineReplyView: View {
ReplyView(sender: sender,
plainBody: content.body,
formattedBody: nil,
icon: .init(kind: .systemIcon("doc.text.fill"), cornerRadii: iconCornerRadii))
icon: .init(kind: .iconAsset(Asset.Images.document), cornerRadii: iconCornerRadii))
case .image(let content):
ReplyView(sender: sender,
plainBody: content.body,
@@ -66,12 +67,12 @@ struct TimelineReplyView: View {
ReplyView(sender: sender,
plainBody: L10n.commonVoiceMessage,
formattedBody: nil,
icon: .init(kind: .icon(Asset.Images.microphone.name), cornerRadii: iconCornerRadii))
icon: .init(kind: .icon(\.micOnOutline), cornerRadii: iconCornerRadii))
case .location:
ReplyView(sender: sender,
plainBody: L10n.commonSharedLocation,
formattedBody: nil,
icon: .init(kind: .icon(Asset.Images.locationMarker.name), cornerRadii: iconCornerRadii))
icon: .init(kind: .iconAsset(Asset.Images.addLocation), cornerRadii: iconCornerRadii))
}
default:
LoadingReplyView()
@@ -100,7 +101,8 @@ struct TimelineReplyView: View {
enum Kind {
case mediaSource(MediaSourceProxy)
case systemIcon(String)
case icon(String)
case iconAsset(ImageAsset)
case icon(KeyPath<CompoundIcons, Image>)
}
let kind: Kind
@@ -191,11 +193,13 @@ struct TimelineReplyView: View {
.resizable()
.aspectRatio(contentMode: .fit)
.padding(8.0)
case .icon(let iconName):
Image(iconName)
case .iconAsset(let asset):
Image(asset: asset)
.resizable()
.aspectRatio(contentMode: .fit)
.padding(8.0)
case .icon(let keyPath):
CompoundIcon(keyPath, size: .small, relativeTo: .body)
}
}
}
@@ -14,13 +14,14 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct SwipeToReplyView: View {
let timelineItem: RoomTimelineItemProtocol
var body: some View {
Image(systemName: "arrowshape.turn.up.left")
CompoundIcon(customImage: Asset.Images.reply.swiftUIImage)
.foregroundColor(.compound.iconPrimary)
.accessibilityHidden(true)
}
@@ -14,7 +14,9 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct TimelineDeliveryStatusView: View {
enum Status {
case sending
@@ -23,20 +25,18 @@ struct TimelineDeliveryStatusView: View {
let deliveryStatus: Status
private var systemImageName: String {
private var icon: CompoundIcon {
switch deliveryStatus {
case .sending:
return "circle"
return CompoundIcon(customImage: Asset.Images.circle.swiftUIImage, size: .xSmall, relativeTo: .compound.bodyMD)
case .sent:
return "checkmark.circle"
return CompoundIcon(\.checkCircle, size: .xSmall, relativeTo: .compound.bodyMD)
}
}
var body: some View {
Image(systemName: systemImageName)
.resizable()
icon
.foregroundColor(.compound.iconSecondary)
.frame(width: 16.0, height: 16.0)
}
}
@@ -54,12 +54,12 @@ struct EncryptedRoomTimelineView_Previews: PreviewProvider, TestablePreview {
static var body: some View {
VStack(alignment: .leading, spacing: 20.0) {
EncryptedRoomTimelineView(timelineItem: itemWith(text: "Text",
EncryptedRoomTimelineView(timelineItem: itemWith(text: L10n.commonWaitingForDecryptionKey,
timestamp: "Now",
isOutgoing: false,
senderId: "Bob"))
EncryptedRoomTimelineView(timelineItem: itemWith(text: "Some other text",
EncryptedRoomTimelineView(timelineItem: itemWith(text: L10n.commonWaitingForDecryptionKey,
timestamp: "Later",
isOutgoing: true,
senderId: "Anne"))
@@ -132,7 +132,7 @@ struct SettingsScreen: View {
})
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.screenLock)
ListRow(label: .default(title: L10n.commonReportABug,
ListRow(label: .default(title: L10n.commonReportAProblem,
systemIcon: .ladybug),
kind: .navigationLink {
context.send(viewAction: .reportBug)
@@ -89,15 +89,12 @@ struct UserDetailsEditScreen: View {
}
private var avatarOverlayIcon: some View {
Image(systemName: "camera")
.font(.system(size: 14, weight: .semibold))
.padding(3)
.imageScale(.small)
CompoundIcon(customImage: Asset.Images.editing.swiftUIImage, size: .xSmall, relativeTo: .compound.bodyLG)
.foregroundColor(.white)
.padding(4)
.background {
Circle()
.foregroundColor(.black)
.aspectRatio(1, contentMode: .fill)
}
}