diff --git a/Mail/Components/SelectionBackground.swift b/Mail/Components/SelectionBackground.swift index f0ba725a0..881d32cd5 100644 --- a/Mail/Components/SelectionBackground.swift +++ b/Mail/Components/SelectionBackground.swift @@ -26,15 +26,6 @@ enum SelectionBackgroundKind { case folder case single - var verticalPadding: CGFloat { - switch self { - case .multiple: - return 2 - default: - return 0 - } - } - var opacity: Double { switch self { case .none: @@ -59,7 +50,7 @@ struct SelectionBackground: View { @AppStorage(UserDefaults.shared.key(.accentColor)) private var accentColor = DefaultPreferences.accentColor let selectionType: SelectionBackgroundKind - var paddingLeading: CGFloat = 8 + var paddingLeading = UIConstants.selectionBackgroundDefaultLeadingPadding var withAnimation = true var body: some View { @@ -67,7 +58,7 @@ struct SelectionBackground: View { .fill(selectionType == .single ? MailResourcesAsset.elementsColor.swiftUIColor : accentColor.secondary.swiftUIColor) .clipShape(RoundedCorner(radius: 8, corners: [.topLeft, .bottomLeft])) .padding(.leading, paddingLeading) - .padding(.vertical, selectionType.verticalPadding) + .padding(.vertical, UIConstants.selectionBackgroundVerticalPadding) .opacity(selectionType.opacity) .animation(withAnimation ? .default : nil, value: selectionType.opacity) } diff --git a/MailCore/UI/UIConstants.swift b/MailCore/UI/UIConstants.swift index a6089f802..3a7b9540d 100644 --- a/MailCore/UI/UIConstants.swift +++ b/MailCore/UI/UIConstants.swift @@ -95,6 +95,9 @@ public enum UIConstants { public static let checkboxAppearDelay = 0.2 public static let checkboxDisappearOffsetDelay = 0.35 + public static let selectionBackgroundDefaultLeadingPadding: CGFloat = 8 + public static let selectionBackgroundVerticalPadding: CGFloat = 2 + public static let buttonsRadius: CGFloat = 16 public static let buttonsIconSize: CGFloat = 16