mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
Dynamic Popup/Dropdown shortcut
This commit is contained in:
parent
5321352184
commit
e29745f8f4
6 changed files with 139 additions and 19 deletions
|
|
@ -63,7 +63,25 @@ struct DynamicIslandHeader: View {
|
|||
|
||||
if Defaults[.enableClipboardManager] && Defaults[.showClipboardIcon] {
|
||||
Button(action: {
|
||||
showClipboardPopover.toggle()
|
||||
// Use the same smart logic as the keyboard shortcut
|
||||
let displayMode = Defaults[.clipboardDisplayMode]
|
||||
let shouldUseWindow: Bool
|
||||
|
||||
switch displayMode {
|
||||
case .window:
|
||||
shouldUseWindow = true
|
||||
case .popover:
|
||||
shouldUseWindow = false
|
||||
case .auto:
|
||||
// For header button clicks, prefer popover since user is already interacting with notch
|
||||
shouldUseWindow = false
|
||||
}
|
||||
|
||||
if shouldUseWindow {
|
||||
ClipboardWindowManager.shared.toggleClipboardWindow()
|
||||
} else {
|
||||
showClipboardPopover.toggle()
|
||||
}
|
||||
}) {
|
||||
Capsule()
|
||||
.fill(.black)
|
||||
|
|
|
|||
|
|
@ -1589,7 +1589,7 @@ struct ClipboardSettings: View {
|
|||
@Default(.enableClipboardManager) var enableClipboardManager
|
||||
@Default(.clipboardHistorySize) var clipboardHistorySize
|
||||
@Default(.showClipboardIcon) var showClipboardIcon
|
||||
@Default(.clipboardWindowMode) var clipboardWindowMode
|
||||
@Default(.clipboardDisplayMode) var clipboardDisplayMode
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
|
|
@ -1612,7 +1612,24 @@ struct ClipboardSettings: View {
|
|||
Section {
|
||||
Defaults.Toggle("Show Clipboard Icon", key: .showClipboardIcon)
|
||||
|
||||
Defaults.Toggle("Window Mode", key: .clipboardWindowMode)
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Text("Display Mode")
|
||||
Spacer()
|
||||
Picker("Display Mode", selection: $clipboardDisplayMode) {
|
||||
ForEach(ClipboardDisplayMode.allCases, id: \.self) { mode in
|
||||
Text(mode.displayName).tag(mode)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
.frame(width: 140)
|
||||
}
|
||||
|
||||
Text(clipboardDisplayMode.description)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
.padding(.leading, 0)
|
||||
}
|
||||
|
||||
HStack {
|
||||
Text("History Size")
|
||||
|
|
@ -1650,7 +1667,7 @@ struct ClipboardSettings: View {
|
|||
} header: {
|
||||
Text("Settings")
|
||||
} footer: {
|
||||
Text("Window Mode shows clipboard in a moveable window like Raycast with tabs for history and favorites. When disabled, clipboard appears in a popover attached to the Dynamic Island.")
|
||||
Text("Auto mode intelligently chooses between popover (desktop) and window (fullscreen apps) for the best experience. You can override this with manual selection.")
|
||||
}
|
||||
|
||||
Section {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue