From 9928f1b3c102997fd4d7e3ac9e9d599fb7c16b3b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 9 Dec 2025 00:55:04 +0100 Subject: [PATCH] macOS: extract attributed string helper --- .../Sources/Clawdis/NSAttributedString+VoiceWake.swift | 9 +++++++++ apps/macos/Sources/Clawdis/VoiceWakeOverlay.swift | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 apps/macos/Sources/Clawdis/NSAttributedString+VoiceWake.swift diff --git a/apps/macos/Sources/Clawdis/NSAttributedString+VoiceWake.swift b/apps/macos/Sources/Clawdis/NSAttributedString+VoiceWake.swift new file mode 100644 index 000000000..cb4be4258 --- /dev/null +++ b/apps/macos/Sources/Clawdis/NSAttributedString+VoiceWake.swift @@ -0,0 +1,9 @@ +import Foundation + +extension NSAttributedString { + func strippingForegroundColor() -> NSAttributedString { + let mutable = NSMutableAttributedString(attributedString: self) + mutable.removeAttribute(.foregroundColor, range: NSRange(location: 0, length: mutable.length)) + return mutable + } +} diff --git a/apps/macos/Sources/Clawdis/VoiceWakeOverlay.swift b/apps/macos/Sources/Clawdis/VoiceWakeOverlay.swift index e6e96b19a..fffa7ffa6 100644 --- a/apps/macos/Sources/Clawdis/VoiceWakeOverlay.swift +++ b/apps/macos/Sources/Clawdis/VoiceWakeOverlay.swift @@ -663,11 +663,3 @@ private final class TranscriptNSTextView: NSTextView { super.keyDown(with: event) } } - -private extension NSAttributedString { - func strippingForegroundColor() -> NSAttributedString { - let mutable = NSMutableAttributedString(attributedString: self) - mutable.removeAttribute(.foregroundColor, range: NSRange(location: 0, length: mutable.length)) - return mutable - } -}