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/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 } 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) */ 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 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)) } }