added haptics and sounds for the bell

its the warning haptic and the Tink.caf 1103 system sound
added warning haptic
This commit is contained in:
neon443
2025-08-24 21:44:35 +01:00
parent d4f31fda32
commit f2d034b732
2 changed files with 18 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import UIKit
enum Haptic {
case success
case warning
case error
case light
case medium
@@ -22,7 +23,7 @@ enum Haptic {
switch self {
case .light, .medium, .heavy, .soft, .rigid:
return true
case .success, .error:
case .success, .warning, .error:
return false
}
}
@@ -57,6 +58,8 @@ enum Haptic {
switch self {
case .success:
UINotificationFeedbackGenerator().notificationOccurred(.success)
case .warning:
UINotificationFeedbackGenerator().notificationOccurred(.warning)
case .error:
UINotificationFeedbackGenerator().notificationOccurred(.error)
default: print("idk atp")

View File

@@ -6,6 +6,7 @@
//
import SwiftUI
import AudioToolbox
struct ShellView: View {
@ObservedObject var handler: SSHHandler
@@ -26,10 +27,23 @@ struct ShellView: View {
Color.gray.opacity(0.2)
.transition(.opacity)
Image(systemName: "bell.fill")
.foregroundStyle(
hostsManager.selectedTheme.background.luminance > 0.5 ?
.black : .white
)
.font(.largeTitle)
.shadow(color: .black, radius: 5)
}
.opacity(handler.bell ? 1 : 0)
.onChange(of: handler.bell) { _ in
guard handler.bell else { return }
if hostsManager.settings.bellHaptic {
Haptic.warning.trigger()
}
if hostsManager.settings.bellSound {
AudioServicesPlaySystemSound(1103)
}
}
}
}
}