Add space between section header and feed url, since macOS doesn't add it like it should

This commit is contained in:
Maurice Parker 2020-07-18 20:22:41 -05:00
parent 68f4ea88c9
commit 9240c8e8a9
1 changed files with 20 additions and 15 deletions

View File

@ -100,21 +100,26 @@ struct InspectorView: View {
#endif
Section(header: Text("Feed URL")) {
Text(verbatim: (sidebarItem.feed as? WebFeed)?.url ?? "")
.fixedSize(horizontal: false, vertical: true)
.contextMenu(ContextMenu(menuItems: {
Button(action: {
if let urlString = (sidebarItem.feed as? WebFeed)?.url {
#if os(macOS)
URLPasteboardWriter.write(urlString: urlString, to: NSPasteboard.general)
#else
UIPasteboard.general.string = urlString
#endif
}
}, label: {
Text("Copy Feed URL")
})
}))
VStack {
#if os(macOS)
Spacer() // This shouldn't be necessary, but for some reason macOS doesn't put the space in itself
#endif
Text(verbatim: (sidebarItem.feed as? WebFeed)?.url ?? "")
.fixedSize(horizontal: false, vertical: true)
.contextMenu(ContextMenu(menuItems: {
Button(action: {
if let urlString = (sidebarItem.feed as? WebFeed)?.url {
#if os(macOS)
URLPasteboardWriter.write(urlString: urlString, to: NSPasteboard.general)
#else
UIPasteboard.general.string = urlString
#endif
}
}, label: {
Text("Copy Feed URL")
})
}))
}
}
#if os(macOS)