Am Netz ohne Laden: Pausenzeichen statt Stecker
„Laden angehalten" ist die Aussage. Ein Stecker sagt nur „Kabel steckt", und das sieht man am Kabel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -33,20 +33,24 @@ public enum BatteryGlyph {
|
|||||||
/// Am Netz, aber es fließt nichts — meist, weil das Ladelimit erreicht
|
/// Am Netz, aber es fließt nichts — meist, weil das Ladelimit erreicht
|
||||||
/// ist. Ohne eigenes Zeichen sieht das aus wie Akkubetrieb, und man
|
/// ist. Ohne eigenes Zeichen sieht das aus wie Akkubetrieb, und man
|
||||||
/// fragt sich, ob das Kabel wirklich steckt.
|
/// fragt sich, ob das Kabel wirklich steckt.
|
||||||
case plug
|
///
|
||||||
|
/// Als Pausenzeichen und nicht als Stecker: „Laden angehalten" ist die
|
||||||
|
/// Aussage, und ein Stecker sagt nur „Kabel steckt" — das sieht man
|
||||||
|
/// ohnehin am Kabel.
|
||||||
|
case paused
|
||||||
|
|
||||||
public var symbolName: String? {
|
public var symbolName: String? {
|
||||||
switch self {
|
switch self {
|
||||||
case .none: nil
|
case .none: nil
|
||||||
case .bolt: "bolt.fill"
|
case .bolt: "bolt.fill"
|
||||||
case .plug: "powerplug.fill"
|
case .paused: "pause.fill"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func indicator(isCharging: Bool, isPluggedIn: Bool) -> Indicator {
|
public static func indicator(isCharging: Bool, isPluggedIn: Bool) -> Indicator {
|
||||||
if isCharging { return .bolt }
|
if isCharging { return .bolt }
|
||||||
return isPluggedIn ? .plug : .none
|
return isPluggedIn ? .paused : .none
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Wo der Blitz auf der Füllung liegt und wo im Leerraum.
|
/// Wo der Blitz auf der Füllung liegt und wo im Leerraum.
|
||||||
|
|||||||
@@ -75,10 +75,12 @@ struct BatteryIndicatorTests {
|
|||||||
#expect(BatteryGlyph.indicator(isCharging: true, isPluggedIn: true) == .bolt)
|
#expect(BatteryGlyph.indicator(isCharging: true, isPluggedIn: true) == .bolt)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test("Am Netz ohne Laden der Stecker")
|
@Test("Am Netz ohne Laden das Pausenzeichen")
|
||||||
func pluggedButIdleShowsPlug() {
|
func pluggedButIdleShowsPause() {
|
||||||
// Der Fall, um den es geht: Ladelimit erreicht.
|
// Der Fall, um den es geht: Ladelimit erreicht. „Laden angehalten" ist
|
||||||
#expect(BatteryGlyph.indicator(isCharging: false, isPluggedIn: true) == .plug)
|
// die Aussage — ein Stecker sagte nur „Kabel steckt", und das sieht man
|
||||||
|
// am Kabel.
|
||||||
|
#expect(BatteryGlyph.indicator(isCharging: false, isPluggedIn: true) == .paused)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test("Im Akkubetrieb gar nichts")
|
@Test("Im Akkubetrieb gar nichts")
|
||||||
|
|||||||
Reference in New Issue
Block a user