mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Adopt Compound Colours (#1086)
* Delete deprecated font tokens. * Migrate from primaryContent to textPrimary/iconPrimary. * Migrate from links to textLinkExternal. * Migrate from secondaryContent to textSecondary/iconSecondary. * Migrate from accent to textActionPrimary. - Some uses changed to textPrimary or iconPrimary as necessary. - Some manual tints removed now that that Sentry is fixed. * Migrate alert to textCriticalPrimary/iconCriticalPrimary. * Migrate from brand to textActionAccent/iconAccentTertiary. * Migrate from background to bgCanvasDefault or text/iconOnSolidPrimary * Migrate system to bgSubtleSecondary. * Remove ElementUIColors and obsolete migrated colours. * Migrate tertiaryContent/quaternaryContent/quinaryContent to Compound. * Migrate bubblesYou/bubblesNotYou to use Compound. * Update Compound.
This commit is contained in:
@@ -123,7 +123,7 @@ struct HomeScreen: View {
|
||||
.navigationTitle(L10n.screenRoomlistMainSpaceTitle)
|
||||
.toolbar(showingBottomToolbar ? .automatic : .hidden, for: .bottomBar)
|
||||
.toolbar { toolbar }
|
||||
.background(Color.element.background.ignoresSafeArea())
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.track(screen: .home)
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ struct HomeScreen: View {
|
||||
HStack(spacing: 16) {
|
||||
Text(L10n.sessionVerificationBannerTitle)
|
||||
.font(.compound.bodyLGSemibold)
|
||||
.foregroundColor(.element.systemPrimaryLabel)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
|
||||
Spacer()
|
||||
|
||||
@@ -203,13 +203,13 @@ struct HomeScreen: View {
|
||||
context.send(viewAction: .skipSessionVerification)
|
||||
} label: {
|
||||
Image(systemName: "xmark")
|
||||
.foregroundColor(.element.secondaryContent)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.frame(width: 12, height: 12)
|
||||
}
|
||||
}
|
||||
Text(L10n.sessionVerificationBannerMessage)
|
||||
.font(.compound.bodyMD)
|
||||
.foregroundColor(.element.secondaryContent)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
}
|
||||
|
||||
Button(L10n.actionContinue) {
|
||||
@@ -220,7 +220,7 @@ struct HomeScreen: View {
|
||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.verificationBannerContinue)
|
||||
}
|
||||
.padding(16)
|
||||
.background(Color.element.system)
|
||||
.background(Color.compound.bgSubtleSecondary)
|
||||
.cornerRadius(14)
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ struct HomeScreenInvitesButton: View {
|
||||
Button(action: action) {
|
||||
HStack(spacing: 8) {
|
||||
Text(title)
|
||||
.foregroundColor(.element.primaryContent)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
.font(.compound.bodyMD)
|
||||
|
||||
if hasBadge {
|
||||
@@ -43,7 +43,7 @@ struct HomeScreenInvitesButton: View {
|
||||
private var badge: some View {
|
||||
Circle()
|
||||
.frame(width: badgeSize, height: badgeSize)
|
||||
.foregroundColor(.element.brand)
|
||||
.foregroundColor(.compound.iconAccentTertiary)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ struct HomeScreenRoomCell: View {
|
||||
.padding(.vertical, verticalInsets)
|
||||
.overlay(alignment: .bottom) {
|
||||
Rectangle()
|
||||
.fill(Color.element.quinaryContent)
|
||||
.fill(Color.compound._borderRowSeparator)
|
||||
.frame(height: 1 / UIScreen.main.scale)
|
||||
.padding(.trailing, -horizontalInsets)
|
||||
}
|
||||
@@ -86,14 +86,14 @@ struct HomeScreenRoomCell: View {
|
||||
HStack(alignment: .top, spacing: 16) {
|
||||
Text(room.name)
|
||||
.font(.compound.bodyLGSemibold)
|
||||
.foregroundColor(.element.primaryContent)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
if let timestamp = room.timestamp {
|
||||
Text(timestamp)
|
||||
.font(.compound.bodySM)
|
||||
.foregroundColor(room.hasUnreads ? .element.brand : .element.tertiaryContent)
|
||||
.foregroundColor(room.hasUnreads ? .compound.textActionAccent : .compound.textSecondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ struct HomeScreenRoomCell: View {
|
||||
if room.hasUnreads {
|
||||
Circle()
|
||||
.frame(width: 12, height: 12)
|
||||
.foregroundColor(.element.brand)
|
||||
.foregroundColor(.compound.iconAccentTertiary)
|
||||
.padding(.leading, 12)
|
||||
} else {
|
||||
// Force extra padding between last message text and the right border of the screen if there is no unread dot
|
||||
@@ -149,7 +149,7 @@ struct HomeScreenRoomCellButtonStyle: ButtonStyle {
|
||||
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
configuration.label
|
||||
.background(configuration.isPressed || isSelected ? Color.element.system : .clear)
|
||||
.background(configuration.isPressed || isSelected ? Color.compound.bgSubtleSecondary : .clear)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ struct HomeScreenRoomCellButtonStyle: ButtonStyle {
|
||||
private extension View {
|
||||
func lastMessageFormatting() -> some View {
|
||||
font(.compound.bodyMD)
|
||||
.foregroundColor(.element.tertiaryContent)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
.lineLimit(2)
|
||||
.multilineTextAlignment(.leading)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user