mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Run SwiftFormat.
This commit is contained in:
@@ -69,7 +69,7 @@ public struct CompoundButtonStyle: ButtonStyle {
|
||||
case .toolbarIcon: 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var verticalPadding: CGFloat {
|
||||
if kind == .textLink {
|
||||
return 0
|
||||
@@ -103,7 +103,7 @@ public struct CompoundButtonStyle: ButtonStyle {
|
||||
private var isUnderlined: Bool {
|
||||
kind == .textLink && accessibilityShowButtonShapes
|
||||
}
|
||||
|
||||
|
||||
public func makeBody(configuration: Self.Configuration) -> some View {
|
||||
configuration.label
|
||||
.font(font)
|
||||
@@ -147,7 +147,7 @@ public struct CompoundButtonStyle: ButtonStyle {
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var contentShape: AnyShape {
|
||||
switch kind {
|
||||
case .super, .primary, .secondary, .tertiary:
|
||||
@@ -156,7 +156,7 @@ public struct CompoundButtonStyle: ButtonStyle {
|
||||
return AnyShape(Rectangle())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func fillColor(configuration: Self.Configuration) -> Color {
|
||||
guard isEnabled else { return .compound.bgActionPrimaryDisabled }
|
||||
if configuration.role == .destructive {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class CompoundColors {
|
||||
}
|
||||
|
||||
// MARK: - Decorative Colors
|
||||
|
||||
|
||||
// Used to determine the background and text colors of avatars, usernames etc.
|
||||
|
||||
let decorativeColors: [DecorativeColor]
|
||||
|
||||
@@ -25,7 +25,7 @@ public struct CompoundGradients {
|
||||
.compound.gradientActionStop3,
|
||||
.compound.gradientActionStop4])
|
||||
}
|
||||
|
||||
|
||||
public var subtle: Gradient {
|
||||
.init(colors: [.compound.gradientSubtleStop1,
|
||||
.compound.gradientSubtleStop2,
|
||||
@@ -34,7 +34,7 @@ public struct CompoundGradients {
|
||||
.compound.gradientSubtleStop5,
|
||||
.compound.gradientSubtleStop6])
|
||||
}
|
||||
|
||||
|
||||
public var info: Gradient {
|
||||
.init(colors: [.compound.gradientInfoStop1, .compound.gradientInfoStop2])
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public final nonisolated class CompoundUIColors {
|
||||
public var _bgCodeBlock: UIColor {
|
||||
CompoundUIColors.coreTokens.gray100
|
||||
}
|
||||
|
||||
|
||||
/// This token is a placeholder and hasn't been finalised.
|
||||
@available(iOS, deprecated: 100000.0, message: "This token should be generated by now.")
|
||||
public let _bgSubtleSecondaryAlpha = coreTokens.alphaGray300
|
||||
|
||||
@@ -21,7 +21,7 @@ struct ListInlinePicker<SelectedValue: Hashable>: View {
|
||||
kind: .selection(isSelected: !isWaiting ? selection == item.tag : false) {
|
||||
var transaction = Transaction()
|
||||
transaction.disablesAnimations = true
|
||||
|
||||
|
||||
withTransaction(transaction) {
|
||||
selection = item.tag
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public struct ListRow<Icon: View, DetailsIcon: View, CustomContent: View, Select
|
||||
.tint(.compound.iconAccentTertiary)
|
||||
.foregroundStyle(isEnabled ? .compound.textPrimary : .compound.textDisabled)
|
||||
.listRowInsets(ListRowPadding.textFieldInsets)
|
||||
|
||||
|
||||
case .custom(let content):
|
||||
content()
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public struct ListRowAccessory: View {
|
||||
private var verticalPaddingFix: CGFloat {
|
||||
-4
|
||||
}
|
||||
|
||||
|
||||
/// Absolute bodge until we have the circle icon in Compound.
|
||||
@ScaledMetric private var circleOverlayInsets = 5
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ public struct ListRowLabel<Icon: View>: View {
|
||||
guard isEnabled else { return .compound.textDisabled }
|
||||
return role == .destructive ? .compound.textCriticalPrimary : .compound.textPrimary
|
||||
}
|
||||
|
||||
|
||||
var titleLineLimit: Int? {
|
||||
layout == .avatar ? 1 : lineLimit
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public struct ListRowLabel<Icon: View>: View {
|
||||
var descriptionColor: Color {
|
||||
isEnabled ? .compound.textSecondary : .compound.textDisabled
|
||||
}
|
||||
|
||||
|
||||
var descriptionLineLimit: Int? {
|
||||
guard layout == .avatar else { return lineLimit }
|
||||
return role != .error ? 1 : lineLimit
|
||||
|
||||
@@ -30,7 +30,7 @@ private struct ListRowDetailsLabelStyle: LabelStyle {
|
||||
/// This consists of both the `ListRowDetails` and the `ListRowAccessory`.
|
||||
public struct ListRowTrailingSection<Icon: View>: View {
|
||||
@Environment(\.isEnabled) private var isEnabled
|
||||
|
||||
|
||||
private var title: String?
|
||||
private var icon: Icon?
|
||||
private var counter: Int?
|
||||
|
||||
@@ -11,7 +11,7 @@ import SwiftUI
|
||||
|
||||
struct SnapshotPrecisionPreferenceKey: PreferenceKey {
|
||||
static var defaultValue: Float = 1.0
|
||||
|
||||
|
||||
static func reduce(value: inout Float, nextValue: () -> Float) {
|
||||
value = nextValue()
|
||||
}
|
||||
@@ -19,7 +19,7 @@ struct SnapshotPrecisionPreferenceKey: PreferenceKey {
|
||||
|
||||
struct SnapshotPerceptualPrecisionPreferenceKey: PreferenceKey {
|
||||
static var defaultValue: Float = 0.98
|
||||
|
||||
|
||||
static func reduce(value: inout Float, nextValue: () -> Float) {
|
||||
value = nextValue()
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ struct SearchStyle_Previews: PreviewProvider, TestablePreview {
|
||||
Text("Settings")
|
||||
.compoundListSectionHeader()
|
||||
}
|
||||
|
||||
|
||||
Section {
|
||||
ListRow(label: .plain(title: "Some setting"),
|
||||
kind: .toggle(.constant(true)))
|
||||
|
||||
Reference in New Issue
Block a user