From ee970370562917d35e4709d6976439fe4b8260f8 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 3 Jan 2025 17:47:19 +0100 Subject: [PATCH 1/5] more modern view of the settings view controllers --- deltachat-ios/Controller/Settings/AdvancedViewController.swift | 2 +- .../Controller/Settings/AutodelOptionsViewController.swift | 2 +- .../Controller/Settings/AutodelOverviewViewController.swift | 2 +- .../Controller/Settings/ChatsAndMediaViewController.swift | 2 +- .../Controller/Settings/DownloadOnDemandViewController.swift | 2 +- .../Controller/Settings/EmailOptionsViewController.swift | 2 +- .../Controller/Settings/MediaQualityViewController.swift | 2 +- .../Controller/Settings/SelfProfileViewController.swift | 2 +- deltachat-ios/Controller/Settings/SettingsViewController.swift | 2 +- .../Controller/Settings/VideoChatInstanceViewController.swift | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deltachat-ios/Controller/Settings/AdvancedViewController.swift b/deltachat-ios/Controller/Settings/AdvancedViewController.swift index 77753876a..885d708af 100644 --- a/deltachat-ios/Controller/Settings/AdvancedViewController.swift +++ b/deltachat-ios/Controller/Settings/AdvancedViewController.swift @@ -273,7 +273,7 @@ internal final class AdvancedViewController: UITableViewController { init(dcAccounts: DcAccounts) { self.dcContext = dcAccounts.getSelected() self.dcAccounts = dcAccounts - super.init(style: .grouped) + super.init(style: .insetGrouped) hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift b/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift index 8c071ba8e..100c8a036 100644 --- a/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift +++ b/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift @@ -70,7 +70,7 @@ class AutodelOptionsViewController: UITableViewController { self.dcContext = dcContext self.fromServer = fromServer self.currVal = dcContext.getConfigInt(fromServer ? "delete_server_after" : "delete_device_after") - super.init(style: .grouped) + super.init(style: .insetGrouped) self.title = String.localized("delete_old_messages") hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift b/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift index a6cebd52c..a3a05bb1d 100644 --- a/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift +++ b/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift @@ -45,7 +45,7 @@ class AutodelOverviewViewController: UITableViewController { init(dcContext: DcContext) { self.dcContext = dcContext - super.init(style: .grouped) + super.init(style: .insetGrouped) self.title = String.localized("delete_old_messages") hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift b/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift index fedb66c6e..8fbd04e1a 100644 --- a/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift +++ b/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift @@ -111,7 +111,7 @@ internal final class ChatsAndMediaViewController: UITableViewController { init(dcAccounts: DcAccounts) { self.dcContext = dcAccounts.getSelected() self.dcAccounts = dcAccounts - super.init(style: .grouped) + super.init(style: .insetGrouped) hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift b/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift index b159a0970..c3feaefa9 100644 --- a/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift +++ b/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift @@ -17,7 +17,7 @@ class DownloadOnDemandViewController: UITableViewController { init(dcContext: DcContext) { self.dcContext = dcContext self.options = [0, 163840, 655360, 5242880, 26214400] - super.init(style: .grouped) + super.init(style: .insetGrouped) self.title = String.localized("auto_download_messages") hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift b/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift index d7dbedb84..8dc9cbda3 100644 --- a/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift +++ b/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift @@ -17,7 +17,7 @@ class EmailOptionsViewController: UITableViewController { init(dcContext: DcContext) { self.dcContext = dcContext self.options = [Int(DC_SHOW_EMAILS_OFF), Int(DC_SHOW_EMAILS_ACCEPTED_CONTACTS), Int(DC_SHOW_EMAILS_ALL)] - super.init(style: .grouped) + super.init(style: .insetGrouped) self.title = String.localized("pref_show_emails") hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/MediaQualityViewController.swift b/deltachat-ios/Controller/Settings/MediaQualityViewController.swift index 2fe43f388..32b960845 100644 --- a/deltachat-ios/Controller/Settings/MediaQualityViewController.swift +++ b/deltachat-ios/Controller/Settings/MediaQualityViewController.swift @@ -17,7 +17,7 @@ class MediaQualityViewController: UITableViewController { init(dcContext: DcContext) { self.dcContext = dcContext self.options = [Int(DC_MEDIA_QUALITY_BALANCED), Int(DC_MEDIA_QUALITY_WORSE)] - super.init(style: .grouped) + super.init(style: .insetGrouped) self.title = String.localized("pref_outgoing_media_quality") hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/SelfProfileViewController.swift b/deltachat-ios/Controller/Settings/SelfProfileViewController.swift index a0fc3f21e..cc339247b 100644 --- a/deltachat-ios/Controller/Settings/SelfProfileViewController.swift +++ b/deltachat-ios/Controller/Settings/SelfProfileViewController.swift @@ -49,7 +49,7 @@ class SelfProfileViewController: UITableViewController, MediaPickerDelegate { init(dcAccounts: DcAccounts) { self.dcAccounts = dcAccounts self.dcContext = dcAccounts.getSelected() - super.init(style: .grouped) + super.init(style: .insetGrouped) hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/Settings/SettingsViewController.swift b/deltachat-ios/Controller/Settings/SettingsViewController.swift index 490468781..cdb4fab0a 100644 --- a/deltachat-ios/Controller/Settings/SettingsViewController.swift +++ b/deltachat-ios/Controller/Settings/SettingsViewController.swift @@ -161,7 +161,7 @@ internal final class SettingsViewController: UITableViewController { init(dcAccounts: DcAccounts) { self.dcContext = dcAccounts.getSelected() self.dcAccounts = dcAccounts - super.init(style: .grouped) + super.init(style: .insetGrouped) // set connectivity changed observer before we acutally init `connectivityCell.detailTextLabel` in `updateCells()`, // otherwise, we may miss events and the label is not correct. diff --git a/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift b/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift index ab6f4eb8d..3cc857626 100644 --- a/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift +++ b/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift @@ -62,7 +62,7 @@ class VideoChatInstanceViewController: UITableViewController { init(dcContext: DcContext) { self.dcContext = dcContext - super.init(style: .grouped) + super.init(style: .insetGrouped) self.updateSelected(selectedCustom: false) self.title = String.localized("videochat_instance") hidesBottomBarWhenPushed = true From 7196e3c49abef1e550b632da12a6ba4c67bc1162 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 3 Jan 2025 17:50:18 +0100 Subject: [PATCH 2/5] more modern view of the proxy-settings view controllers --- .../Controller/Settings/Proxy/ProxySettingsViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deltachat-ios/Controller/Settings/Proxy/ProxySettingsViewController.swift b/deltachat-ios/Controller/Settings/Proxy/ProxySettingsViewController.swift index 6b0eac4a9..bb75cd2e2 100644 --- a/deltachat-ios/Controller/Settings/Proxy/ProxySettingsViewController.swift +++ b/deltachat-ios/Controller/Settings/Proxy/ProxySettingsViewController.swift @@ -42,7 +42,7 @@ class ProxySettingsViewController: UITableViewController { addProxyCell.actionTitle = String.localized("proxy_add") toggleProxyCell = SwitchCell(textLabel: String.localized("proxy_use_proxy"), on: dcContext.isProxyEnabled) - super.init(style: .grouped) + super.init(style: .insetGrouped) tableView.register(SwitchCell.self, forCellReuseIdentifier: SwitchCell.reuseIdentifier) tableView.register(ActionCell.self, forCellReuseIdentifier: ActionCell.reuseIdentifier) From 7fb684b1c4170f67a5c4819bbfa1bf19995d5847 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 3 Jan 2025 17:54:11 +0100 Subject: [PATCH 3/5] more modern view of the accout-settings view controllers --- .../Controller/AccountSetup/AccountSetupController.swift | 2 +- .../Controller/AccountSetup/CertificateCheckController.swift | 2 +- .../Controller/AccountSetup/SecuritySettingsController.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deltachat-ios/Controller/AccountSetup/AccountSetupController.swift b/deltachat-ios/Controller/AccountSetup/AccountSetupController.swift index 7832234c1..3a3216df3 100644 --- a/deltachat-ios/Controller/AccountSetup/AccountSetupController.swift +++ b/deltachat-ios/Controller/AccountSetup/AccountSetupController.swift @@ -280,7 +280,7 @@ class AccountSetupController: UITableViewController { self.imapSecurityValue = AccountSetupSecurityValue(initValue: dcContext.getConfigInt("mail_security")) self.smtpSecurityValue = AccountSetupSecurityValue(initValue: dcContext.getConfigInt("send_security")) - super.init(style: .grouped) + super.init(style: .insetGrouped) hidesBottomBarWhenPushed = true } diff --git a/deltachat-ios/Controller/AccountSetup/CertificateCheckController.swift b/deltachat-ios/Controller/AccountSetup/CertificateCheckController.swift index 31160a609..d127fd8a0 100644 --- a/deltachat-ios/Controller/AccountSetup/CertificateCheckController.swift +++ b/deltachat-ios/Controller/AccountSetup/CertificateCheckController.swift @@ -25,7 +25,7 @@ class CertificateCheckController: UITableViewController { for (index, value) in options.enumerated() where currentValue == value { selectedIndex = index } - super.init(style: .grouped) + super.init(style: .insetGrouped) self.title = sectionTitle } diff --git a/deltachat-ios/Controller/AccountSetup/SecuritySettingsController.swift b/deltachat-ios/Controller/AccountSetup/SecuritySettingsController.swift index 48bfddf9a..7f63e0fe0 100644 --- a/deltachat-ios/Controller/AccountSetup/SecuritySettingsController.swift +++ b/deltachat-ios/Controller/AccountSetup/SecuritySettingsController.swift @@ -21,7 +21,7 @@ class SecuritySettingsController: UITableViewController { init(initValue: Int, title: String) { selectedIndex = options.firstIndex(of: Int32(initValue)) ?? 0 - super.init(style: .grouped) + super.init(style: .insetGrouped) self.title = title } From 6904c259740108f7d90d6ff95e731cb6834bd514 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 3 Jan 2025 18:01:44 +0100 Subject: [PATCH 4/5] more modern view of the profile-settings view controllers --- deltachat-ios/Controller/ContactDetailViewController.swift | 2 +- deltachat-ios/Controller/EditContactController.swift | 2 +- deltachat-ios/Controller/EditGroupViewController.swift | 2 +- deltachat-ios/Controller/EphemeralMessagesViewController.swift | 2 +- deltachat-ios/Controller/GroupChatDetailViewController.swift | 2 +- deltachat-ios/Controller/NewGroupController.swift | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deltachat-ios/Controller/ContactDetailViewController.swift b/deltachat-ios/Controller/ContactDetailViewController.swift index 3b448581f..015f3b8c3 100644 --- a/deltachat-ios/Controller/ContactDetailViewController.swift +++ b/deltachat-ios/Controller/ContactDetailViewController.swift @@ -146,7 +146,7 @@ class ContactDetailViewController: UITableViewController { init(dcContext: DcContext, contactId: Int) { self.viewModel = ContactDetailViewModel(dcContext: dcContext, contactId: contactId) - super.init(style: .grouped) + super.init(style: .insetGrouped) NotificationCenter.default.addObserver(self, selector: #selector(ContactDetailViewController.handleContactsChanged(_:)), name: Event.contactsChanged, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(ContactDetailViewController.handleIncomingMessage(_:)), name: Event.incomingMessage, object: nil) diff --git a/deltachat-ios/Controller/EditContactController.swift b/deltachat-ios/Controller/EditContactController.swift index c516e4cda..0d71cde7d 100644 --- a/deltachat-ios/Controller/EditContactController.swift +++ b/deltachat-ios/Controller/EditContactController.swift @@ -13,7 +13,7 @@ class EditContactController: UITableViewController { dcContact = dcContext.getContact(id: contactIdForUpdate) authNameOrAddr = dcContact.authName.isEmpty ? dcContact.email : dcContact.authName cells = [nameCell] - super.init(style: .grouped) + super.init(style: .insetGrouped) nameCell.textFieldDelegate = self nameCell.textField.text = dcContact.editedName diff --git a/deltachat-ios/Controller/EditGroupViewController.swift b/deltachat-ios/Controller/EditGroupViewController.swift index 6a563d4bc..7ef6c000e 100644 --- a/deltachat-ios/Controller/EditGroupViewController.swift +++ b/deltachat-ios/Controller/EditGroupViewController.swift @@ -51,7 +51,7 @@ class EditGroupViewController: UITableViewController, MediaPickerDelegate { } else { self.editRows = [.name, .avatar] } - super.init(style: .grouped) + super.init(style: .insetGrouped) self.avatarSelectionCell.hintLabel.text = String.localized(useGroupWording ? "group_avatar" : "image") self.avatarSelectionCell.onAvatarTapped = onAvatarTapped title = String.localized(useGroupWording ? "menu_edit_group" : "global_menu_edit_desktop") diff --git a/deltachat-ios/Controller/EphemeralMessagesViewController.swift b/deltachat-ios/Controller/EphemeralMessagesViewController.swift index 656e242e6..3197f61bd 100644 --- a/deltachat-ios/Controller/EphemeralMessagesViewController.swift +++ b/deltachat-ios/Controller/EphemeralMessagesViewController.swift @@ -31,7 +31,7 @@ class EphemeralMessagesViewController: UITableViewController { init(dcContext: DcContext, chatId: Int) { self.dcContext = dcContext self.chatId = chatId - super.init(style: .grouped) + super.init(style: .insetGrouped) // select option close to the timespan (that may no be available as an option eg. in case option have changed) self.currentIndex = 0 diff --git a/deltachat-ios/Controller/GroupChatDetailViewController.swift b/deltachat-ios/Controller/GroupChatDetailViewController.swift index 33b6ceec4..72e6e642f 100644 --- a/deltachat-ios/Controller/GroupChatDetailViewController.swift +++ b/deltachat-ios/Controller/GroupChatDetailViewController.swift @@ -57,7 +57,7 @@ class GroupChatDetailViewController: UIViewController { }() lazy var tableView: UITableView = { - let table = UITableView(frame: .zero, style: .grouped) + let table = UITableView(frame: .zero, style: .insetGrouped) table.register(ActionCell.self, forCellReuseIdentifier: ActionCell.reuseIdentifier) table.register(ContactCell.self, forCellReuseIdentifier: ContactCell.reuseIdentifier) table.delegate = self diff --git a/deltachat-ios/Controller/NewGroupController.swift b/deltachat-ios/Controller/NewGroupController.swift index 4e40c0c09..5d213f0be 100644 --- a/deltachat-ios/Controller/NewGroupController.swift +++ b/deltachat-ios/Controller/NewGroupController.swift @@ -77,7 +77,7 @@ class NewGroupController: UITableViewController, MediaPickerDelegate { templateChat = nil } self.groupContactIds = Array(contactIdsForGroup) - super.init(style: .grouped) + super.init(style: .insetGrouped) } required init?(coder _: NSCoder) { From bb33de50a214fb977110bf5904d4503e06ecc984 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 3 Jan 2025 18:18:26 +0100 Subject: [PATCH 5/5] adjust profile header to new inset --- deltachat-ios/View/ContactDetailHeader.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/deltachat-ios/View/ContactDetailHeader.swift b/deltachat-ios/View/ContactDetailHeader.swift index 59fa76001..af191d677 100644 --- a/deltachat-ios/View/ContactDetailHeader.swift +++ b/deltachat-ios/View/ContactDetailHeader.swift @@ -129,7 +129,8 @@ class ContactDetailHeader: UIView { } private func setupSubviews() { - let margin: CGFloat = 10 + let lrMargin: CGFloat = 16 + let spacing: CGFloat = 10 let horizontalStackView = UIStackView(arrangedSubviews: [searchButton, muteButton]) addSubview(avatar) @@ -142,22 +143,22 @@ class ContactDetailHeader: UIView { addConstraints([ avatar.constraintWidthTo(badgeSize), avatar.constraintHeightTo(badgeSize), - avatar.constraintAlignLeadingTo(self, paddingLeading: badgeSize / 4), + avatar.constraintAlignLeadingTo(self, paddingLeading: lrMargin), avatar.constraintCenterYTo(self), greenCheckmark.constraintHeightTo(titleLabel.font.pointSize * 0.9), greenCheckmark.widthAnchor.constraint(equalTo: greenCheckmark.heightAnchor), ]) - labelsContainer.leadingAnchor.constraint(equalTo: avatar.trailingAnchor, constant: margin).isActive = true + labelsContainer.leadingAnchor.constraint(equalTo: avatar.trailingAnchor, constant: spacing).isActive = true labelsContainer.centerYAnchor.constraint(equalTo: avatar.centerYAnchor).isActive = true - labelsContainer.trailingAnchor.constraint(equalTo: horizontalStackView.leadingAnchor, constant: -margin).isActive = true + labelsContainer.trailingAnchor.constraint(equalTo: horizontalStackView.leadingAnchor, constant: -spacing).isActive = true horizontalStackView.axis = .horizontal horizontalStackView.distribution = .fillEqually horizontalStackView.alignment = .center - horizontalStackView.constraintAlignTrailingToAnchor(trailingAnchor, paddingTrailing: margin).isActive = true + horizontalStackView.constraintAlignTrailingToAnchor(trailingAnchor, paddingTrailing: lrMargin).isActive = true horizontalStackView.constraintCenterYTo(self).isActive = true - horizontalStackView.spacing = margin + horizontalStackView.spacing = spacing } func updateDetails(title: String?, subtitle: String?) {