mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-29 16:14:33 +00:00
Feature: Favourites
This commit is contained in:
parent
79b16570b5
commit
5321352184
7 changed files with 627 additions and 32 deletions
|
|
@ -445,38 +445,45 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
// Only open clipboard if the feature is enabled
|
||||
guard Defaults[.enableClipboardManager] else { return }
|
||||
|
||||
// Find the appropriate view model based on mouse location
|
||||
let mouseLocation = NSEvent.mouseLocation
|
||||
var viewModel = self.vm
|
||||
|
||||
if Defaults[.showOnAllDisplays] {
|
||||
for screen in NSScreen.screens {
|
||||
if screen.frame.contains(mouseLocation) {
|
||||
if let screenViewModel = self.viewModels[screen] {
|
||||
viewModel = screenViewModel
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Open the notch if it's closed
|
||||
if viewModel.notchState == .closed {
|
||||
viewModel.open()
|
||||
|
||||
// Wait a bit for the notch to open before toggling clipboard
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
||||
self.coordinator.toggleClipboardPopover()
|
||||
}
|
||||
} else {
|
||||
// If notch is already open, toggle immediately
|
||||
self.coordinator.toggleClipboardPopover()
|
||||
}
|
||||
|
||||
// Start clipboard monitoring if not already running
|
||||
if !ClipboardManager.shared.isMonitoring {
|
||||
ClipboardManager.shared.startMonitoring()
|
||||
}
|
||||
|
||||
// Check if window mode is enabled
|
||||
if Defaults[.clipboardWindowMode] {
|
||||
// Use window interface
|
||||
ClipboardWindowManager.shared.toggleClipboardWindow()
|
||||
} else {
|
||||
// Use traditional popover interface
|
||||
// Find the appropriate view model based on mouse location
|
||||
let mouseLocation = NSEvent.mouseLocation
|
||||
var viewModel = self.vm
|
||||
|
||||
if Defaults[.showOnAllDisplays] {
|
||||
for screen in NSScreen.screens {
|
||||
if screen.frame.contains(mouseLocation) {
|
||||
if let screenViewModel = self.viewModels[screen] {
|
||||
viewModel = screenViewModel
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Open the notch if it's closed
|
||||
if viewModel.notchState == .closed {
|
||||
viewModel.open()
|
||||
|
||||
// Wait a bit for the notch to open before toggling clipboard
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
||||
self.coordinator.toggleClipboardPopover()
|
||||
}
|
||||
} else {
|
||||
// If notch is already open, toggle immediately
|
||||
self.coordinator.toggleClipboardPopover()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !Defaults[.showOnAllDisplays] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue