mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-14 05:21:12 +00:00
Enable font scaling on iOS
This commit is contained in:
parent
0a0e985e33
commit
22af2db36c
2 changed files with 6 additions and 12 deletions
|
@ -71,12 +71,10 @@ struct DisplaySettingsView: View {
|
|||
Text(buttonStyle.description).tag(buttonStyle)
|
||||
}
|
||||
}
|
||||
if ProcessInfo.processInfo.isiOSAppOnMac {
|
||||
VStack {
|
||||
Slider(value: $userPreferences.fontSizeScale, in: 0.5 ... 1.5, step: 0.1)
|
||||
Text("Font scaling: \(String(format: "%.1f", userPreferences.fontSizeScale))")
|
||||
.font(.scaledBody)
|
||||
}
|
||||
VStack {
|
||||
Slider(value: $userPreferences.fontSizeScale, in: 0.5 ... 1.5, step: 0.1)
|
||||
Text("Font scaling: \(String(format: "%.1f", userPreferences.fontSizeScale))")
|
||||
.font(.scaledBody)
|
||||
}
|
||||
Toggle("settings.display.translate-button", isOn: $userPreferences.showTranslateButton)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public extension Font {
|
|||
return .custom(chosenFont.fontName, size: size, relativeTo: textStyle)
|
||||
}
|
||||
|
||||
return onMac ? .system(size: size) : .system(textStyle)
|
||||
return .system(size: size)
|
||||
}
|
||||
|
||||
private static func customUIFont(size: CGFloat) -> UIFont {
|
||||
|
@ -31,11 +31,7 @@ public extension Font {
|
|||
}
|
||||
|
||||
private static func userScaledFontSize(baseSize: CGFloat) -> CGFloat {
|
||||
if onMac {
|
||||
return UIFontMetrics.default.scaledValue(for: baseSize * UserPreferences.shared.fontSizeScale)
|
||||
}
|
||||
|
||||
return baseSize
|
||||
UIFontMetrics.default.scaledValue(for: baseSize * UserPreferences.shared.fontSizeScale)
|
||||
}
|
||||
|
||||
static var scaledTitle: Font {
|
||||
|
|
Loading…
Reference in a new issue