diff --git a/Impedance Converter/Impedance Converter.xcodeproj/project.pbxproj b/Impedance Converter/Impedance Converter.xcodeproj/project.pbxproj index ce06e8e..02591ae 100644 --- a/Impedance Converter/Impedance Converter.xcodeproj/project.pbxproj +++ b/Impedance Converter/Impedance Converter.xcodeproj/project.pbxproj @@ -460,6 +460,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -491,6 +492,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Impedance Converter/Impedance Converter/Segment7Standard.otf b/Impedance Converter/Impedance Converter/Segment7Standard.otf index 7429b0d..76269a3 100644 Binary files a/Impedance Converter/Impedance Converter/Segment7Standard.otf and b/Impedance Converter/Impedance Converter/Segment7Standard.otf differ diff --git a/Impedance Converter/Impedance Converter/UnitInputView.swift b/Impedance Converter/Impedance Converter/UnitInputView.swift index 6da6ddb..f132baf 100644 --- a/Impedance Converter/Impedance Converter/UnitInputView.swift +++ b/Impedance Converter/Impedance Converter/UnitInputView.swift @@ -163,7 +163,6 @@ struct UnitInputView: View where UnitType: RawRepresentable & Hashable TextField("", text: $displayedValue) .multilineTextAlignment(.trailing) .font(.custom("Segment7Standard", size: 30)) - .kerning(3) .lineLimit(1) .minimumScaleFactor(0.5) .foregroundColor(Color.basePrimaryOrange.adjusted(brightness: disabled() ? 0.5 : 1.6)) @@ -174,7 +173,6 @@ struct UnitInputView: View where UnitType: RawRepresentable & Hashable TextField("", text: $displayedValue) .multilineTextAlignment(.trailing) .font(.custom("Segment7Standard", size: 30)) - .kerning(3) .lineLimit(1) .minimumScaleFactor(0.5) .foregroundColor(Color.basePrimaryOrange.adjusted(brightness: disabled() ? 0.5 : 1.5)) @@ -208,27 +206,57 @@ struct UnitInputView: View where UnitType: RawRepresentable & Hashable } .toolbar { ToolbarItemGroup(placement: .keyboard) { - if isFocused { - if showNegationDecorator { + if #available(iOS 16, *) { + // iOS 16 and above layout (without HStack) + if isFocused { + if showNegationDecorator { + Spacer() + Button(action: toggleNegation) { + Text("-") + .font(.custom("Segment7Standard", size: 30)) + .foregroundColor(.black) + } + .frame(minWidth: 44) + } Spacer() - Button(action: toggleNegation) { - Text("-") - .font(.custom("Segment7Standard", size: 30)) - .foregroundColor(.black) + ForEach(unitCases, id: \.self) { unitCase in + Button(action: { + selectUnit(unitCase) + }) { + Text(unitCase.shouldRender ? unitCase.rawValue : unitCases.count == 1 ? "⏎" : "_") + .foregroundColor(Color.baseSecondaryRed.adjusted(brightness: 1.5)) + .fontWeight(unitCase == unit ? .bold : .regular) + } + .frame(minWidth: 44) + Spacer() } - .frame(minWidth: 44) } - Spacer() - ForEach(unitCases, id: \.self) { unitCase in - Button(action: { - selectUnit(unitCase) - }) { - Text(unitCase.shouldRender ? unitCase.rawValue : unitCases.count == 1 ? "⏎" : "_") - .foregroundColor(Color.baseSecondaryRed.adjusted(brightness: 1.5)) - .fontWeight(unitCase == unit ? .bold : .regular) + } else { + // iOS 15 layout (with HStack) (but not centered) + HStack { + if isFocused { + if showNegationDecorator { + Spacer() + Button(action: toggleNegation) { + Text("-") + .font(.custom("Segment7Standard", size: 30)) + .foregroundColor(.black) + } + .frame(minWidth: 44) + } + Spacer() + ForEach(unitCases, id: \.self) { unitCase in + Button(action: { + selectUnit(unitCase) + }) { + Text(unitCase.shouldRender ? unitCase.rawValue : unitCases.count == 1 ? "⏎" : "_") + .foregroundColor(Color.baseSecondaryRed.adjusted(brightness: 1.5)) + .fontWeight(unitCase == unit ? .bold : .regular) + } + .frame(minWidth: 44) + Spacer() + } } - .frame(minWidth: 44) - Spacer() } } }