Working Text Clipboard

This commit is contained in:
Hariharan Mudaliar 2025-07-17 20:21:49 +05:30
commit 4890e6fc28
8 changed files with 631 additions and 4 deletions

View file

@ -94,8 +94,8 @@ struct ContentView: View {
isHovering = hovering
}
// Only close if mouse leaves and the notch is open
if !hovering && vm.notchState == .open {
// Only close if mouse leaves and the notch is open and no popovers are active
if !hovering && vm.notchState == .open && !vm.isBatteryPopoverActive && !vm.isClipboardPopoverActive {
vm.close()
}
}
@ -148,6 +148,13 @@ struct ContentView: View {
}
}
}
.onChange(of: vm.isClipboardPopoverActive) { _, newPopoverState in
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
if !newPopoverState && !isHovering && vm.notchState == .open && !vm.isBatteryPopoverActive {
vm.close()
}
}
}
.sensoryFeedback(.alignment, trigger: haptics)
.contextMenu {
SettingsLink(label: {
@ -477,8 +484,8 @@ struct ContentView: View {
isHovering = false
}
// Close the notch if it's open and battery popover is not active
if vm.notchState == .open && !vm.isBatteryPopoverActive {
// Close the notch if it's open and no popovers are active
if vm.notchState == .open && !vm.isBatteryPopoverActive && !vm.isClipboardPopoverActive {
vm.close()
}
}