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