Skip to content

Commit

Permalink
Merge pull request #343 from Infomaniak/font-and-UI-check
Browse files Browse the repository at this point in the history
Font and UI check
  • Loading branch information
PhilippeWeidmann authored Oct 7, 2022
2 parents 6a9308f + 1a93026 commit 08edccd
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Mail/Components/FloatingActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct FloatingActionButton: View {
.buttonBorderShape(.capsule)
.controlSize(.large)
.padding(.trailing, 24)
.padding(.bottom, 40)
.padding(.bottom, 70)
}
}

Expand Down
16 changes: 9 additions & 7 deletions Mail/Components/ThreadCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extension Animation {

extension ThreadDensity {
var cellVerticalPadding: CGFloat {
self == .compact ? 8 : 16
self == .compact ? 14 : 16
}
}

Expand All @@ -47,8 +47,8 @@ struct ThreadCell: View {

var thread: Thread

var isMultipleSelectionEnabled: Bool = false
var isSelected: Bool = false
var isMultipleSelectionEnabled = false
var isSelected = false

private var textStyle: MailTextStyle {
thread.hasUnseenMessages ? .header3 : .bodySecondary
Expand Down Expand Up @@ -149,8 +149,10 @@ struct ThreadCell: View {

if thread.hasAttachments {
Image(resource: MailResourcesAsset.attachmentMail1)
.resizable()
.foregroundColor(textStyle.color)
.frame(height: 10)
.scaledToFit()
.frame(width: 16)
}

Text(thread.date.customRelativeFormatted)
Expand All @@ -160,7 +162,7 @@ struct ThreadCell: View {
}

private var threadInfo: some View {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 1) {
Text(thread.formattedSubject)
.textStyle(textStyle)
.lineLimit(1)
Expand All @@ -169,7 +171,7 @@ struct ThreadCell: View {
let preview = thread.messages.last?.preview,
!preview.isEmpty {
Text(preview)
.textStyle(.bodySecondary)
.textStyle(thread.hasUnseenMessages ? .body : .bodySecondary)
.lineLimit(1)
}
}
Expand All @@ -181,7 +183,7 @@ struct ThreadCell: View {
Image(resource: MailResourcesAsset.starFull)
.resizable()
.scaledToFit()
.frame(width: 20, height: 20)
.frame(width: 16, height: 16)
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions Mail/Views/Menu Drawer/Folders/FolderCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct FolderCellContent: View {
}

private var textStyle: MailTextStyle {
isSelected ? .button : .body
isSelected ? .header3Primary : .header5
}

var body: some View {
Expand All @@ -96,7 +96,8 @@ struct FolderCellContent: View {

if folder.unreadCount != nil {
Text(folder.formattedUnreadCount)
.textStyle(.calloutHighlighted)
.foregroundColor(.accentColor)
.textStyle(isSelected ? .calloutStrong : .calloutHighlighted)
}
}
.padding(.vertical, Constants.menuDrawerVerticalPadding)
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Menu Drawer/Folders/UserFoldersListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct UserFoldersListView: View {
} label: {
HStack {
Text(MailResourcesStrings.Localizable.buttonFolders)
.textStyle(.body)
.textStyle(.calloutSectionSecondary)
Spacer()
ChevronIcon(style: isExpanded ? .up : .down, color: .primary)
}
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Menu Drawer/Items/MenuDrawerItemsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct MenuDrawerItemsListView: View {
VStack(alignment: .leading, spacing: 16) {
if let title = title {
Text(title)
.textStyle(.calloutSecondary)
.textStyle(.calloutSectionSecondary)
}

ForEach(content) { item in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct MailboxesManagementView: View {
@State private var avatarImage = Image(resource: MailResourcesAsset.placeholderAvatar)
@State private var isShowingManageAccount = false
@State private var isShowingSwitchAccount = false

var mailboxes: [Mailbox]

private var otherMailboxes: [Mailbox] {
Expand All @@ -52,7 +52,7 @@ struct MailboxesManagementView: View {
.padding(.trailing, 16)
Text(mailboxManager.mailbox.email)
.foregroundColor(.accentColor)
.textStyle(.header3)
.textStyle(.header4)
.lineLimit(1)
Spacer()
ChevronIcon(style: isExpanded ? .up : .down, color: .primary)
Expand Down
1 change: 1 addition & 0 deletions Mail/Views/Thread List/ThreadListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct ThreadListCell: View {
}
.onAppear { viewModel.loadNextPageIfNeeded(currentItem: thread) }
.padding(.leading, multipleSelectionViewModel.isEnabled ? 8 : 0)
.padding(.vertical, -4)
.onTapGesture { didTapCell() }
.onLongPressGesture(minimumDuration: 0.3) { didLongPressCell() }
.swipeActions(thread: thread, viewModel: viewModel, multipleSelectionViewModel: multipleSelectionViewModel)
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Thread List/ThreadListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct ThreadListView: View {
} header: {
if threadDensity != .compact {
Text(section.title)
.textStyle(.calloutSecondary)
.textStyle(.calloutSection)
}
}
}
Expand Down
53 changes: 39 additions & 14 deletions MailCore/Utils/MailTextStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,72 +56,97 @@ public struct MailTextStyle {
}

public static let header1 = MailTextStyle(
font: .system(size: 22, weight: .semibold),
font: .system(size: 21.5, weight: .bold),
color: MailResourcesAsset.primaryTextColor
)

public static let header2 = MailTextStyle(
font: .system(size: 18, weight: .semibold),
font: .system(size: 17.5, weight: .bold),
color: MailResourcesAsset.primaryTextColor
)

public static let header2Secondary = MailTextStyle(
font: .system(size: 18),
font: .system(size: 17.5),
color: MailResourcesAsset.secondaryTextColor
)

public static let header3 = MailTextStyle(
font: .system(size: 16, weight: .semibold),
font: .system(size: 15.5, weight: .bold),
color: MailResourcesAsset.primaryTextColor
)

public static let header3Primary = MailTextStyle(
font: .system(size: 15.5, weight: .bold),
color: \.primary
)

public static let header4 = MailTextStyle(
font: .system(size: 15.5, weight: .semibold),
color: MailResourcesAsset.primaryTextColor
)

public static let header5 = MailTextStyle(
font: .system(size: 15.5, weight: .medium),
color: MailResourcesAsset.primaryTextColor
)

public static let body = MailTextStyle(
font: .system(size: 16),
font: .system(size: 15.5),
color: MailResourcesAsset.primaryTextColor
)

public static let bodySecondary = MailTextStyle(
font: .system(size: 16),
font: .system(size: 15.5),
color: MailResourcesAsset.secondaryTextColor
)

public static let button = MailTextStyle(
font: .system(size: 16, weight: .medium),
font: .system(size: 15.5, weight: .medium),
color: \.primary
)

public static let buttonPill = MailTextStyle(
font: .system(size: 16, weight: .semibold),
font: .system(size: 15.5, weight: .semibold),
color: MailResourcesAsset.buttonPillColor
)

public static let calloutStrong = MailTextStyle(
font: .system(size: 14, weight: .semibold),
font: .system(size: 13.5, weight: .bold),
color: MailResourcesAsset.primaryTextColor
)

public static let callout = MailTextStyle(
font: .system(size: 14),
font: .system(size: 13.5),
color: MailResourcesAsset.primaryTextColor
)

public static let calloutSection = MailTextStyle(
font: .system(size: 14.5),
color: MailResourcesAsset.sectionHeaderTextColor
)

public static let calloutSectionSecondary = MailTextStyle(
font: .system(size: 14.5),
color: MailResourcesAsset.secondaryTextColor
)

public static let calloutSecondary = MailTextStyle(
font: .system(size: 14),
font: .system(size: 13.5),
color: MailResourcesAsset.secondaryTextColor
)

public static let calloutHint = MailTextStyle(
font: .system(size: 14),
font: .system(size: 13.5),
color: MailResourcesAsset.hintTextColor
)

public static let calloutHighlighted = MailTextStyle(
font: .system(size: 14),
font: .system(size: 13.5),
color: \.primary
)

public static let caption = MailTextStyle(
font: .system(size: 12),
font: .system(size: 11.5),
color: MailResourcesAsset.secondaryTextColor
)
}
Binary file modified MailResources/en.lproj/Localizable.strings
Binary file not shown.
Binary file modified MailResources/fr.lproj/Localizable.strings
Binary file not shown.

0 comments on commit 08edccd

Please sign in to comment.