From 3ce43ded238a776f7c8a8a9bea339db47adc0c20 Mon Sep 17 00:00:00 2001 From: Bastiaan Verhaar <3987804+bastiaanv@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:03:57 +0200 Subject: [PATCH 1/4] fix: Prevent app crash while moving presets (#540) --- .../View Controllers/OverrideSelectionViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LoopKitUI/View Controllers/OverrideSelectionViewController.swift b/LoopKitUI/View Controllers/OverrideSelectionViewController.swift index 3797da397..956d14e7e 100644 --- a/LoopKitUI/View Controllers/OverrideSelectionViewController.swift +++ b/LoopKitUI/View Controllers/OverrideSelectionViewController.swift @@ -388,7 +388,8 @@ public final class OverrideSelectionViewController: UICollectionViewController, return originalIndexPath } - return proposedIndexPath == indexPathOfCustomOverride() + let customPresetRow = self.collectionView(collectionView, numberOfItemsInSection: proposedIndexPath.section) - 2 + return proposedIndexPath.row >= customPresetRow ? originalIndexPath : proposedIndexPath From 4873b0cce5fdaf89f300e718aba3523b6680979c Mon Sep 17 00:00:00 2001 From: Marion Barker <19607791+marionbarker@users.noreply.github.com> Date: Sun, 6 Oct 2024 08:37:08 -0700 Subject: [PATCH 2/4] Improve the visibility of the options to select (#549) * improve the visibility of the options to select * modify color and lineWidth --- LoopKitUI/Views/CheckmarkListItem.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LoopKitUI/Views/CheckmarkListItem.swift b/LoopKitUI/Views/CheckmarkListItem.swift index d60a6c432..9a1b7c5d9 100644 --- a/LoopKitUI/Views/CheckmarkListItem.swift +++ b/LoopKitUI/Views/CheckmarkListItem.swift @@ -74,8 +74,8 @@ public struct CheckmarkListItem: View { .foregroundColor(.accentColor) } else { Circle() - .stroke() - .foregroundColor(Color(.systemGray4)) + .stroke(lineWidth: 2) + .foregroundColor(Color(.systemGray)) } } From a03be5768e8d9cec87d93f0af9e72c97b7200b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sch=C3=B6mer?= Date: Sun, 6 Oct 2024 20:45:38 +0200 Subject: [PATCH 3/4] fix LoopKit/Loop#2223 (#546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix LoopKit/Loop#2223 accept comma in carb entry Signed-off-by: Jörg Schömer * Remove debug print statements. --------- Signed-off-by: Jörg Schömer Co-authored-by: Pete Schwamb --- LoopKitUI/CarbKit/CarbQuantityRow.swift | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/LoopKitUI/CarbKit/CarbQuantityRow.swift b/LoopKitUI/CarbKit/CarbQuantityRow.swift index 1675bce2e..f2274a12e 100644 --- a/LoopKitUI/CarbKit/CarbQuantityRow.swift +++ b/LoopKitUI/CarbKit/CarbQuantityRow.swift @@ -22,6 +22,7 @@ public struct CarbQuantityRow: View { private let formatter: NumberFormatter = { let formatter = NumberFormatter() formatter.numberStyle = .decimal + formatter.maximumIntegerDigits = 3 formatter.maximumFractionDigits = 1 return formatter }() @@ -76,13 +77,8 @@ public struct CarbQuantityRow: View { // Update quantity based on text field input private func updateQuantity(with input: String) { - let filtered = input.filter { "0123456789.".contains($0) } - if filtered != input { - self.carbInput = filtered - } - - if let doubleValue = Double(filtered) { - quantity = doubleValue + if let number = formatter.number(from: input) { + quantity = number.doubleValue } else { quantity = nil } From c815053e2ea2ad5dbd0828db481a1960b41e626e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sch=C3=B6mer?= Date: Mon, 4 Sep 2023 12:54:13 +0200 Subject: [PATCH 4/4] make favorite food translatable --- LoopKitUI/CarbKit/AbsorptionTimePickerRow.swift | 2 +- LoopKitUI/CarbKit/DatePickerRow.swift | 2 +- LoopKitUI/CarbKit/FoodTypeRow.swift | 2 +- LoopKitUI/Resources/de.lproj/Localizable.strings | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/LoopKitUI/CarbKit/AbsorptionTimePickerRow.swift b/LoopKitUI/CarbKit/AbsorptionTimePickerRow.swift index bd6918cfa..eed785c39 100644 --- a/LoopKitUI/CarbKit/AbsorptionTimePickerRow.swift +++ b/LoopKitUI/CarbKit/AbsorptionTimePickerRow.swift @@ -35,7 +35,7 @@ public struct AbsorptionTimePickerRow: View { public var body: some View { VStack(alignment: .leading, spacing: 0) { HStack { - Text("Absorption Time") + Text(LocalizedString("Absorption Time", comment: "Label Absorption Time in CarbKit")) .foregroundColor(.primary) if showHowAbsorptionTimeWorks != nil { diff --git a/LoopKitUI/CarbKit/DatePickerRow.swift b/LoopKitUI/CarbKit/DatePickerRow.swift index ae741729c..dd31e69fd 100644 --- a/LoopKitUI/CarbKit/DatePickerRow.swift +++ b/LoopKitUI/CarbKit/DatePickerRow.swift @@ -52,7 +52,7 @@ public struct DatePickerRow: View { public var body: some View { VStack(alignment: .leading, spacing: 0) { HStack { - Text("Time") + Text(LocalizedString("Time", comment: "Label Time in CarbKit")) .foregroundColor(.primary) Spacer() diff --git a/LoopKitUI/CarbKit/FoodTypeRow.swift b/LoopKitUI/CarbKit/FoodTypeRow.swift index dd91079b6..6f941d381 100644 --- a/LoopKitUI/CarbKit/FoodTypeRow.swift +++ b/LoopKitUI/CarbKit/FoodTypeRow.swift @@ -41,7 +41,7 @@ public struct FoodTypeRow: View { public var body: some View { HStack { Text("Food Type") - .foregroundColor(.primary) + .foregroundColor(.primary) Spacer() diff --git a/LoopKitUI/Resources/de.lproj/Localizable.strings b/LoopKitUI/Resources/de.lproj/Localizable.strings index 42becd99a..62eb1ab56 100644 --- a/LoopKitUI/Resources/de.lproj/Localizable.strings +++ b/LoopKitUI/Resources/de.lproj/Localizable.strings @@ -646,7 +646,8 @@ Information about workout range relative to correction range */ "This will typically be" = "Ist in der Regel "; -/* Label for offset from midnight picker */ +/* Label for offset from midnight picker + Label Time in CarbKit */ "Time" = "Zeit"; /* The schedule table view header describing the configured time zone difference from the default time zone. The substitution parameters are: (1: time zone name)(2: +/-)(3: time interval) */