Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F12824988
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/macOS/Navigation/PostCommands.swift b/macOS/Navigation/PostCommands.swift
index 2b2d45a..1a2b7b6 100644
--- a/macOS/Navigation/PostCommands.swift
+++ b/macOS/Navigation/PostCommands.swift
@@ -1,25 +1,35 @@
import SwiftUI
struct PostCommands: Commands {
@ObservedObject var model: WriteFreelyModel
var body: some Commands {
CommandMenu("Post") {
+ Button("Find In Posts") {
+ if let toolbar = NSApp.keyWindow?.toolbar,
+ let search = toolbar.items.first(where: {
+ $0.itemIdentifier.rawValue == "com.apple.SwiftUI.search"
+ }) as? NSSearchToolbarItem {
+ search.beginSearchInteraction()
+ }
+ }
+ .keyboardShortcut("f", modifiers: [.command, .shift])
+
Group {
Button(action: sendPostUrlToPasteboard, label: { Text("Copy Link To Published Post") })
.disabled(model.selectedPost?.status == PostStatus.local.rawValue)
}
.disabled(model.selectedPost == nil || !model.account.isLoggedIn)
}
}
private func sendPostUrlToPasteboard() {
guard let activePost = model.selectedPost else { return }
guard let postId = activePost.postId else { return }
guard let urlString = activePost.slug != nil ?
"\(model.account.server)/\((activePost.collectionAlias)!)/\((activePost.slug)!)" :
"\(model.account.server)/\((postId))" else { return }
NSPasteboard.general.clearContents()
NSPasteboard.general.setString(urlString, forType: .string)
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Dec 26, 4:17 AM (19 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3558435
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment