Extracted removeListInsets() and removeSectionBackground()
This commit is contained in:
parent
5ded582c78
commit
ba260b4826
|
@ -78,6 +78,17 @@ extension View {
|
|||
return self.background(Color.systemGroupedBackground)
|
||||
}
|
||||
|
||||
func removeListInsets() -> some View {
|
||||
return self.listRowInsets(EdgeInsets())
|
||||
}
|
||||
|
||||
func removeSectionBackground() -> some View {
|
||||
return self
|
||||
.systemGroupedBackground()
|
||||
.removeListInsets()
|
||||
}
|
||||
|
||||
|
||||
func styleAmount(amount: CommonBigDecimal) -> some View {
|
||||
let amountColor = amount.decimal.isPositive() ? Styles.PositiveAmountColor : Styles.NegativeAmountColor
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ struct LabelledUIKitTextFieldWithValidationLabel: View {
|
|||
ValidationLabel(validationResult)
|
||||
}
|
||||
}
|
||||
.listRowInsets(EdgeInsets())
|
||||
.removeListInsets()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -102,8 +102,7 @@ struct AccountTransactionsDialog: View {
|
|||
.padding(.horizontal, 6)
|
||||
}
|
||||
.frame(maxWidth: .infinity, minHeight: 44) // has to have at least a height of 44 (iOS 14; iOS 13: 40), otherwise a white line at bottom gets displayed
|
||||
.systemGroupedBackground() // TODO: extract with below .removeSectionBackground() (or create View?)
|
||||
.listRowInsets(EdgeInsets()) // TODO: extract remove list insets
|
||||
.removeListInsets()
|
||||
}
|
||||
|
||||
if showTransactionsList {
|
||||
|
|
|
@ -29,8 +29,7 @@ struct AccountsDialog: View {
|
|||
Section {
|
||||
AddAccountButtonView()
|
||||
}
|
||||
.systemGroupedBackground()
|
||||
.listRowInsets(EdgeInsets())
|
||||
.removeSectionBackground()
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ struct Divider: View {
|
|||
Rectangle()
|
||||
.fill(color)
|
||||
.frame(height: height)
|
||||
.listRowInsets(EdgeInsets())
|
||||
.removeListInsets()
|
||||
.edgesIgnoringSafeArea(.horizontal)
|
||||
.padding(0)
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@ struct InfoLabel: View {
|
|||
.frame(height: 18)
|
||||
}
|
||||
.font(.callout)
|
||||
.systemGroupedBackground()
|
||||
.listRowInsets(EdgeInsets())
|
||||
.removeSectionBackground()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ struct SearchBarWithLabel<Label: View>: View {
|
|||
.padding(.horizontal)
|
||||
.padding(.bottom, 8)
|
||||
}
|
||||
.listRowInsets(EdgeInsets())
|
||||
.removeListInsets()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ struct FlickerCodeTanView: View {
|
|||
.padding(.bottom, 12)
|
||||
}
|
||||
.background(Color.black)
|
||||
.listRowInsets(EdgeInsets())
|
||||
.removeListInsets()
|
||||
}
|
||||
// what a hack to be able to call animator.animate() (otherwise compiler would throw 'use of immutable self in closure' error)
|
||||
.executeMutatingMethod {
|
||||
|
|
Loading…
Reference in New Issue