fix(ui): refine talk overlays

This commit is contained in:
Peter Steinberger
2025-12-30 06:47:35 +01:00
parent 7612a83fa2
commit a7617e4d79
5 changed files with 16 additions and 11 deletions

View File

@@ -7,7 +7,8 @@ import SwiftUI
@Observable
final class TalkOverlayController {
static let shared = TalkOverlayController()
static let overlaySize: CGFloat = 320
static let overlaySize: CGFloat = 360
static let windowInset: CGFloat = 88
private let logger = Logger(subsystem: "com.steipete.clawdis", category: "talk.overlay")
@@ -110,8 +111,8 @@ final class TalkOverlayController {
let size = NSSize(width: Self.overlaySize, height: Self.overlaySize)
let visible = screen.visibleFrame
let origin = CGPoint(
x: visible.maxX - size.width - self.padding,
y: visible.maxY - size.height - self.padding)
x: visible.maxX - size.width - self.padding + Self.windowInset,
y: visible.maxY - size.height - self.padding + Self.windowInset)
return NSRect(origin: origin, size: size)
}
}

View File

@@ -12,8 +12,8 @@ struct TalkOverlayView: View {
level: self.controller.model.level,
accent: self.seamColor)
.frame(width: 96, height: 96)
.padding(.top, 6)
.padding(.trailing, 6)
.padding(.top, 6 + TalkOverlayController.windowInset)
.padding(.trailing, 6 + TalkOverlayController.windowInset)
.contentShape(Circle())
.onTapGesture {
TalkModeController.shared.stopSpeaking(reason: .userTap)
@@ -31,7 +31,7 @@ struct TalkOverlayView: View {
}
.buttonStyle(.plain)
.contentShape(Circle())
.offset(x: -7, y: -7)
.offset(x: -5, y: -5)
.opacity(self.hoveringWindow ? 1 : 0)
.animation(.easeOut(duration: 0.12), value: self.hoveringWindow)
.allowsHitTesting(self.hoveringWindow)