Bladeren bron

Menu & Settings polish

Jonas Björkert 4 maanden geleden
bovenliggende
commit
144b464aff
2 gewijzigde bestanden met toevoegingen van 31 en 13 verwijderingen
  1. 10 10
      LoopFollow/Settings/SettingsMenuView.swift
  2. 21 3
      LoopFollow/ViewControllers/MoreMenuViewController.swift

+ 10 - 10
LoopFollow/Settings/SettingsMenuView.swift

@@ -28,19 +28,19 @@ struct SettingsMenuView: View {
 
                 // ───────── App settings ─────────
                 Section("App Settings") {
-                    NavigationRow(title: "Background Refresh Settings",
+                    NavigationRow(title: "Background Refresh",
                                   icon: "arrow.clockwise")
                     {
                         settingsPath.value.append(Sheet.backgroundRefresh)
                     }
 
-                    NavigationRow(title: "General Settings",
+                    NavigationRow(title: "General",
                                   icon: "gearshape")
                     {
                         settingsPath.value.append(Sheet.general)
                     }
 
-                    NavigationRow(title: "Graph Settings",
+                    NavigationRow(title: "Graph",
                                   icon: "chart.xyaxis.line")
                     {
                         settingsPath.value.append(Sheet.graph)
@@ -52,20 +52,20 @@ struct SettingsMenuView: View {
                         showingTabCustomization = true
                     }
 
-                    NavigationRow(title: "Import/Export Settings",
+                    NavigationRow(title: "Import/Export",
                                   icon: "square.and.arrow.down")
                     {
                         settingsPath.value.append(Sheet.importExport)
                     }
 
                     if !nightscoutURL.value.isEmpty {
-                        NavigationRow(title: "Information Display Settings",
+                        NavigationRow(title: "Information Display",
                                       icon: "info.circle")
                         {
                             settingsPath.value.append(Sheet.infoDisplay)
                         }
 
-                        NavigationRow(title: "Remote Settings",
+                        NavigationRow(title: "Remote",
                                       icon: "antenna.radiowaves.left.and.right")
                         {
                             settingsPath.value.append(Sheet.remote)
@@ -75,7 +75,7 @@ struct SettingsMenuView: View {
 
                 // ───────── Alarms ─────────
                 Section("Alarms") {
-                    NavigationRow(title: "Alarm Settings",
+                    NavigationRow(title: "Alarms",
                                   icon: "bell.badge")
                     {
                         settingsPath.value.append(Sheet.alarmSettings)
@@ -99,7 +99,7 @@ struct SettingsMenuView: View {
 
                 // ───────── Advanced ─────────
                 Section("Advanced Settings") {
-                    NavigationRow(title: "Advanced Settings",
+                    NavigationRow(title: "Advanced",
                                   icon: "exclamationmark.shield")
                     {
                         settingsPath.value.append(Sheet.advanced)
@@ -134,13 +134,13 @@ struct SettingsMenuView: View {
             }
             .pickerStyle(.segmented)
 
-            NavigationRow(title: "Nightscout Settings",
+            NavigationRow(title: "Nightscout",
                           icon: "network")
             {
                 settingsPath.value.append(Sheet.nightscout)
             }
 
-            NavigationRow(title: "Dexcom Settings",
+            NavigationRow(title: "Dexcom",
                           icon: "sensor.tag.radiowaves.forward")
             {
                 settingsPath.value.append(Sheet.dexcom)

+ 21 - 3
LoopFollow/ViewControllers/MoreMenuViewController.swift

@@ -49,7 +49,6 @@ class MoreMenuViewController: UIViewController {
     override func viewDidLoad() {
         super.viewDidLoad()
 
-        title = "Menu"
         view.backgroundColor = .systemBackground
 
         // Apply appearance mode
@@ -105,6 +104,25 @@ class MoreMenuViewController: UIViewController {
         tableView.dataSource = self
         tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
 
+        // Large-title style header
+        let header = UIView()
+        let label = UILabel()
+        label.text = "Menu"
+        label.font = .systemFont(ofSize: 34, weight: .bold)
+        label.translatesAutoresizingMaskIntoConstraints = false
+        header.addSubview(label)
+        NSLayoutConstraint.activate([
+            label.leadingAnchor.constraint(equalTo: header.leadingAnchor, constant: 20),
+            label.topAnchor.constraint(equalTo: header.topAnchor, constant: 8),
+            label.bottomAnchor.constraint(equalTo: header.bottomAnchor, constant: -8),
+        ])
+        header.frame.size = header.systemLayoutSizeFitting(
+            CGSize(width: view.bounds.width, height: UIView.layoutFittingCompressedSize.height),
+            withHorizontalFittingPriority: .required,
+            verticalFittingPriority: .fittingSizeLevel
+        )
+        tableView.tableHeaderView = header
+
         view.addSubview(tableView)
 
         NSLayoutConstraint.activate([
@@ -130,7 +148,7 @@ class MoreMenuViewController: UIViewController {
             ]),
 
             // Section 1: All tab items (static)
-            MenuSection(title: nil, items: TabItem.allCases.map { item in
+            MenuSection(title: "Features", items: TabItem.allCases.map { item in
                 MenuItem(title: item.displayName, icon: item.icon) { [weak self] in
                     self?.openItem(item)
                 }
@@ -152,7 +170,7 @@ class MoreMenuViewController: UIViewController {
                     self?.openURL("https://loopfollowdocs.org/")
                 },
                 MenuItem(title: "Loop and Learn Discord", icon: "bubble.left.and.bubble.right", style: .externalLink) { [weak self] in
-                    self?.openURL("https://discord.gg/TKTuX3dA")
+                    self?.openURL("https://discord.gg/KQgk3gzuYU")
                 },
                 MenuItem(title: "LoopFollow Facebook Group", icon: "person.2.fill", style: .externalLink) { [weak self] in
                     self?.openURL("https://www.facebook.com/groups/loopfollowlnl")