Skip to content

Commit

Permalink
[app] Final cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Dec 27, 2022
1 parent c8d2a57 commit 66c4902
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions App/UI/Keyboard/TerminalKeyInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,12 @@ class TerminalKeyInput: TextInputBase {
inputAssistantItem.allowsHidingShortcuts = false

if #available(iOS 16, *) {
#if swift(>=5.7)
inputAssistantItem.leadingBarButtonGroups += [
.fixedGroup(items: [UIBarButtonItem(customView: leadingView)])
]
inputAssistantItem.trailingBarButtonGroups += [
.fixedGroup(items: [UIBarButtonItem(customView: trailingView)])
]
#endif
} else {
inputAssistantItem.leadingBarButtonGroups += [
UIBarButtonItemGroup(barButtonItems: [UIBarButtonItem(customView: leadingView)], representativeItem: nil)
Expand Down
4 changes: 0 additions & 4 deletions App/UI/Settings/SettingsPerformanceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ struct SettingsPerformanceView: View {
private struct RefreshRate: Hashable {
var rate: Int
var name: String

func hash(into hasher: inout Hasher) {
hasher.combine(rate)
}
}

private let refreshRates = [
Expand Down
8 changes: 1 addition & 7 deletions Common/VT100/StringSupplier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ import SwiftTerm
import SwiftUI

fileprivate extension View {
#if swift(>=5.7)
static func + (lhs: Self, rhs: some View) -> AnyView {
AnyView(ViewBuilder.buildBlock(lhs, AnyView(rhs)))
}
#else
static func + (lhs: Self, rhs: AnyView) -> AnyView {
AnyView(ViewBuilder.buildBlock(lhs, rhs))
}
#endif
}

open class StringSupplier {
Expand Down Expand Up @@ -110,7 +104,7 @@ open class StringSupplier {
font = attribute.style.contains(.italic) ? fontMetrics?.italicFont : fontMetrics?.regularFont
}

let width = CGFloat(run.unicodeScalars.reduce(0, { $0 + UnicodeUtil.columnWidth(rune: $1) })) * fontMetrics!.width
let width = CGFloat(run.unicodeScalars.reduce(0, { $0 + UnicodeUtil.columnWidth(rune: $1) })) * (fontMetrics?.width ?? 0)

return AnyView(
Text(run)
Expand Down

0 comments on commit 66c4902

Please sign in to comment.