From bef7a49a50e8c6ca866ba23635e42c10791a6ba1 Mon Sep 17 00:00:00 2001 From: Alexandru Farcasanu Date: Fri, 22 Nov 2024 12:26:07 +0200 Subject: [PATCH] =?UTF-8?q?FXIOS-10569=20#23140=20=E2=81=83=20[Menu=20Rede?= =?UTF-8?q?sign]=20Fix=20the=20margin=20and=20Padding=20for=20the=20sectio?= =?UTF-8?q?ns/islands=20in=20the=20menu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BrowserKit/Sources/MenuKit/MenuMainView.swift | 4 ++-- BrowserKit/Sources/MenuKit/MenuTableView.swift | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/BrowserKit/Sources/MenuKit/MenuMainView.swift b/BrowserKit/Sources/MenuKit/MenuMainView.swift index d12a318e76be..53d8d2d37cfb 100644 --- a/BrowserKit/Sources/MenuKit/MenuMainView.swift +++ b/BrowserKit/Sources/MenuKit/MenuMainView.swift @@ -43,8 +43,8 @@ public final class MenuMainView: UIView, tableView.topAnchor.constraint(equalTo: accountHeaderView.bottomAnchor), tableView.bottomAnchor.constraint(equalTo: self.bottomAnchor), - tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: -UX.horizontalTableViewMargin), - tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: UX.horizontalTableViewMargin) + tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor), + tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor) ]) } diff --git a/BrowserKit/Sources/MenuKit/MenuTableView.swift b/BrowserKit/Sources/MenuKit/MenuTableView.swift index ed7fdd109cc5..256f008f4c1f 100644 --- a/BrowserKit/Sources/MenuKit/MenuTableView.swift +++ b/BrowserKit/Sources/MenuKit/MenuTableView.swift @@ -16,6 +16,8 @@ class MenuTableView: UIView, ThemeApplicable { private struct UX { static let topPadding: CGFloat = 12 + static let tableViewMargin: CGFloat = 16 + static let distanceBetweenSections: CGFloat = 32 } private var tableView: UITableView @@ -26,6 +28,8 @@ class MenuTableView: UIView, override init(frame: CGRect) { tableView = UITableView(frame: .zero, style: .insetGrouped) + tableView.layoutMargins = UIEdgeInsets(top: 0, left: UX.tableViewMargin, bottom: 0, right: UX.tableViewMargin) + tableView.sectionFooterHeight = 0 menuData = [] super.init(frame: .zero) setupView() @@ -70,7 +74,7 @@ class MenuTableView: UIView, _ tableView: UITableView, heightForHeaderInSection section: Int ) -> CGFloat { - return section == 0 ? UX.topPadding : UITableView.automaticDimension + return section == 0 ? UX.topPadding : UX.distanceBetweenSections } func tableView(