mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Add PostCommands menu to Mac app
This commit is contained in:
parent
09131d5873
commit
6164ceeb99
@ -55,6 +55,7 @@ struct WriteFreely_MultiPlatformApp: App {
|
|||||||
.keyboardShortcut("r", modifiers: [.command])
|
.keyboardShortcut("r", modifiers: [.command])
|
||||||
}
|
}
|
||||||
SidebarCommands()
|
SidebarCommands()
|
||||||
|
PostCommands(post: model.selectedPost)
|
||||||
CommandGroup(after: .help) {
|
CommandGroup(after: .help) {
|
||||||
Button("Visit Support Forum") {
|
Button("Visit Support Forum") {
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
1765F62A24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; };
|
1765F62A24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; };
|
||||||
1765F62B24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; };
|
1765F62B24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; };
|
||||||
17681E412519410E00D394AE /* UINavigationController+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17681E402519410E00D394AE /* UINavigationController+Appearance.swift */; };
|
17681E412519410E00D394AE /* UINavigationController+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17681E402519410E00D394AE /* UINavigationController+Appearance.swift */; };
|
||||||
|
1780F6EF25895EDB00FE45FF /* PostCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1780F6EE25895EDB00FE45FF /* PostCommands.swift */; };
|
||||||
17A5388824DDA31F00DEFF9A /* MacAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388724DDA31F00DEFF9A /* MacAccountView.swift */; };
|
17A5388824DDA31F00DEFF9A /* MacAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388724DDA31F00DEFF9A /* MacAccountView.swift */; };
|
||||||
17A5388C24DDC83F00DEFF9A /* AccountModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388B24DDC83F00DEFF9A /* AccountModel.swift */; };
|
17A5388C24DDC83F00DEFF9A /* AccountModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388B24DDC83F00DEFF9A /* AccountModel.swift */; };
|
||||||
17A5388F24DDEC7400DEFF9A /* AccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388D24DDEC7400DEFF9A /* AccountView.swift */; };
|
17A5388F24DDEC7400DEFF9A /* AccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388D24DDEC7400DEFF9A /* AccountView.swift */; };
|
||||||
@ -141,6 +142,7 @@
|
|||||||
1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WFACollection+CoreDataProperties.swift"; sourceTree = SOURCE_ROOT; };
|
1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WFACollection+CoreDataProperties.swift"; sourceTree = SOURCE_ROOT; };
|
||||||
1765F62924E18EA200C9EBF0 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = "<group>"; };
|
1765F62924E18EA200C9EBF0 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = "<group>"; };
|
||||||
17681E402519410E00D394AE /* UINavigationController+Appearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationController+Appearance.swift"; sourceTree = "<group>"; };
|
17681E402519410E00D394AE /* UINavigationController+Appearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationController+Appearance.swift"; sourceTree = "<group>"; };
|
||||||
|
1780F6EE25895EDB00FE45FF /* PostCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostCommands.swift; sourceTree = "<group>"; };
|
||||||
17A5388724DDA31F00DEFF9A /* MacAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacAccountView.swift; sourceTree = "<group>"; };
|
17A5388724DDA31F00DEFF9A /* MacAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacAccountView.swift; sourceTree = "<group>"; };
|
||||||
17A5388B24DDC83F00DEFF9A /* AccountModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountModel.swift; sourceTree = "<group>"; };
|
17A5388B24DDC83F00DEFF9A /* AccountModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountModel.swift; sourceTree = "<group>"; };
|
||||||
17A5388D24DDEC7400DEFF9A /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = "<group>"; };
|
17A5388D24DDEC7400DEFF9A /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = "<group>"; };
|
||||||
@ -322,6 +324,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
17BC617825715068003363CA /* ActivePostToolbarView.swift */,
|
17BC617825715068003363CA /* ActivePostToolbarView.swift */,
|
||||||
|
1780F6EE25895EDB00FE45FF /* PostCommands.swift */,
|
||||||
);
|
);
|
||||||
path = Navigation;
|
path = Navigation;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -777,6 +780,7 @@
|
|||||||
1756DC0224FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */,
|
1756DC0224FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */,
|
||||||
1756DBB424FECDBB00207AB8 /* PostEditorStatusToolbarView.swift in Sources */,
|
1756DBB424FECDBB00207AB8 /* PostEditorStatusToolbarView.swift in Sources */,
|
||||||
17A5388F24DDEC7400DEFF9A /* AccountView.swift in Sources */,
|
17A5388F24DDEC7400DEFF9A /* AccountView.swift in Sources */,
|
||||||
|
1780F6EF25895EDB00FE45FF /* PostCommands.swift in Sources */,
|
||||||
170DFA35251BBC44001D82A0 /* PostEditorModel.swift in Sources */,
|
170DFA35251BBC44001D82A0 /* PostEditorModel.swift in Sources */,
|
||||||
1756AE7524CB26FA00FD7257 /* PostCellView.swift in Sources */,
|
1756AE7524CB26FA00FD7257 /* PostCellView.swift in Sources */,
|
||||||
17A5388824DDA31F00DEFF9A /* MacAccountView.swift in Sources */,
|
17A5388824DDA31F00DEFF9A /* MacAccountView.swift in Sources */,
|
||||||
|
19
macOS/Navigation/PostCommands.swift
Normal file
19
macOS/Navigation/PostCommands.swift
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct PostCommands: Commands {
|
||||||
|
@State var post: WFAPost?
|
||||||
|
|
||||||
|
var body: some Commands {
|
||||||
|
CommandMenu("Post") {
|
||||||
|
Button("Publish…") {
|
||||||
|
print("Published active post (not really): '\(post?.title ?? "untitled")'")
|
||||||
|
}
|
||||||
|
Button("Move…") {
|
||||||
|
print("Moved active post (not really): '\(post?.title ?? "untitled")'")
|
||||||
|
}
|
||||||
|
Button("Copy Link To Post") {
|
||||||
|
print("Copied URL to post (not really): '\(post?.title ?? "untitled")'")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user