added a separate tab view for clipboard and added the possibility to write notes

This commit is contained in:
delli 2025-12-14 23:24:04 +01:00
commit 4106e845ee
10 changed files with 688 additions and 6 deletions

View file

@ -35,6 +35,7 @@ private enum SettingsTab: String, CaseIterable, Identifiable {
case downloads
case shelf
case shortcuts
case notes
case about
var id: String { rawValue }
@ -58,6 +59,7 @@ private enum SettingsTab: String, CaseIterable, Identifiable {
case .downloads: return "Downloads"
case .shelf: return "Shelf"
case .shortcuts: return "Shortcuts"
case .notes: return "Notes"
case .about: return "About"
}
}
@ -81,6 +83,7 @@ private enum SettingsTab: String, CaseIterable, Identifiable {
case .downloads: return "square.and.arrow.down"
case .shelf: return "books.vertical"
case .shortcuts: return "keyboard"
case .notes: return "note.text"
case .about: return "info.circle"
}
}
@ -104,6 +107,7 @@ private enum SettingsTab: String, CaseIterable, Identifiable {
case .downloads: return .gray
case .shelf: return .brown
case .shortcuts: return .orange
case .notes: return .yellow
case .about: return .secondary
}
}
@ -381,6 +385,7 @@ struct SettingsView: View {
.osd,
.battery,
.stats,
.notes,
.clipboard,
.screenAssistant,
.colorPicker,
@ -812,6 +817,10 @@ struct SettingsView: View {
SettingsForm(tab: .shortcuts) {
Shortcuts()
}
case .notes:
SettingsForm(tab: .notes) {
NotesSettingsView()
}
case .about:
if let controller = updaterController {
SettingsForm(tab: .about) {
@ -4081,9 +4090,11 @@ struct ClipboardSettings: View {
} footer: {
switch clipboardDisplayMode {
case .popover:
Text("Popover mode shows clipboard as a dropdown attached to the clipboard button. Panel mode shows clipboard in a floating window near the notch.")
Text("Popover mode shows clipboard as a dropdown attached to the clipboard button.")
case .panel:
Text("Panel mode shows clipboard in a floating window near the notch. Popover mode shows clipboard as a dropdown attached to the clipboard button.")
Text("Panel mode shows clipboard in a floating window near the notch.")
case .separateTab:
Text("Separate Tab mode integrates Copied Items and Notes into a single view. If both are enabled, Notes appear on the right and Clipboard on the left.")
}
}
@ -4690,3 +4701,27 @@ struct SettingsPermissionCallout: View {
#Preview {
HUD()
}
struct NotesSettingsView: View {
@EnvironmentObject var vm: DynamicIslandViewModel
@ObservedObject var coordinator = DynamicIslandViewCoordinator.shared
private func highlightID(_ title: String) -> String {
SettingsTab.notes.highlightID(for: title)
}
var body: some View {
Form {
Section {
Defaults.Toggle("Enable Notes", key: .enableNotes)
} header: {
Text("General")
} footer: {
Text("Enabling notes will add a quick access button to the Dynamic Island header.")
.font(.caption)
.foregroundStyle(.secondary)
}
}
.navigationTitle("Notes")
}
}