Working Screen Assistant with snipping

This commit is contained in:
Hariharan Mudaliar 2025-09-22 00:39:40 +05:30
commit 2f7821f4fd
20 changed files with 4007 additions and 2 deletions

View file

@ -93,6 +93,10 @@ class ColorPickerPanel: NSPanel {
.fullScreenAuxiliary // Float above full-screen apps
]
// Apply screen capture hiding setting
updateScreenCaptureVisibility()
setupScreenCaptureObserver()
// Accept mouse moved events for proper hover behavior
acceptsMouseMovedEvents = true
@ -156,6 +160,29 @@ class ColorPickerPanel: NSPanel {
// Save position whenever it changes (user dragging)
saveCurrentPosition()
}
private func setupScreenCaptureObserver() {
// Observe changes to hidePanelsFromScreenCapture setting
Defaults.observe(.hidePanelsFromScreenCapture) { [weak self] change in
DispatchQueue.main.async {
self?.updateScreenCaptureVisibility()
}
}
}
private func updateScreenCaptureVisibility() {
let shouldHide = Defaults[.hidePanelsFromScreenCapture]
if shouldHide {
// Hide from screen capture and recording
self.sharingType = .none
print("🙈 ColorPickerPanel: Hidden from screen capture and recordings")
} else {
// Allow normal screen capture
self.sharingType = .readOnly
print("👁️ ColorPickerPanel: Visible in screen capture and recordings")
}
}
}
struct ColorPickerPanelView: View {