Fixed making whole cell tapable

This commit is contained in:
dankito 2020-10-04 22:36:40 +02:00
parent 6f62690444
commit ebce0000c5
7 changed files with 11 additions and 4 deletions

View File

@ -60,6 +60,11 @@ extension View {
}
func makeBackgroundTapable() -> some View {
return self.background(Color.systemBackground)
}
func detailForegroundColor() -> some View {
return self
.foregroundColor(Color.secondary)

View File

@ -44,7 +44,7 @@ struct SettingsDialog: View {
NavigationLink(destination: EmptyView(), isActive: .constant(false)) { // we need custom navigation handling, so disable that NavigationLink takes care of navigating
Text("Secure app data")
.frame(maxWidth: .infinity, alignment: .leading) // stretch over full width
.background(Color.systemBackground) // make background tapable
.makeBackgroundTapable()
}
}
.onTapGesture {

View File

@ -55,6 +55,7 @@ struct AccountTransactionListItem: View {
Spacer()
}
}
.makeBackgroundTapable()
.contextMenu {
if transaction.canCreateMoneyTransferFrom {
Button(action: { self.navigateToTransferMoneyDialog(TransferMoneyData.Companion().fromAccountTransactionWithoutAmountAndReference(transaction: self.transaction)) }) {

View File

@ -23,7 +23,7 @@ struct AllBanksListItem: View {
AmountLabel(banks.sumBalances())
}
.frame(height: 35)
.background(Color.systemBackground) // make background tapable
.makeBackgroundTapable()
}
.onTapGesture {
SceneDelegate.navigateToView(AccountTransactionsDialog(allBanks: self.banks))

View File

@ -13,7 +13,7 @@ struct BankAccountListItem : View {
NavigationLink(destination: LazyView(AccountTransactionsDialog(account: self.account)), isActive: $navigateToAccountTransactionsDialog) {
LabelledAmount(account.displayName, account.balance, account.currency)
.frame(height: 35)
.background(Color.systemBackground) // make background tapable
.makeBackgroundTapable()
}
.disabled( !account.isAccountTypeSupportedByApplication)
.contextMenu {

View File

@ -23,7 +23,7 @@ struct BankListItem : View {
AmountLabel(bank.balance)
}
.frame(height: 35)
.background(Color.systemBackground) // make background tapable
.makeBackgroundTapable()
.contextMenu {
Button(action: { self.navigateToBankSettingsDialog() }) {
HStack {

View File

@ -42,6 +42,7 @@ struct RecipientListItem: View {
.padding(.bottom, 6.0)
}
.makeBackgroundTapable()
}
}