2020-07-18 00:34:11 +02:00
|
|
|
//
|
|
|
|
// SidebarContextMenu.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 7/17/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct SidebarContextMenu: View {
|
|
|
|
|
2020-07-18 11:34:04 +02:00
|
|
|
@Binding var showInspector: Bool
|
2020-07-18 00:34:11 +02:00
|
|
|
var sidebarItem: SidebarItem
|
|
|
|
|
2020-07-18 11:34:04 +02:00
|
|
|
|
2020-07-18 00:34:11 +02:00
|
|
|
@ViewBuilder var body: some View {
|
|
|
|
|
|
|
|
if sidebarItem.representedType == .account {
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
2020-07-18 11:34:04 +02:00
|
|
|
showInspector = true
|
2020-07-18 01:05:26 +02:00
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Get Info")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.getInfoImage
|
|
|
|
#endif
|
|
|
|
}
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Mark All As Read")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.markAllAsReadImage
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if sidebarItem.representedType == .pseudoFeed {
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Mark All As Read")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.markAllAsReadImage
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if sidebarItem.representedType == .webFeed {
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
2020-07-18 11:34:04 +02:00
|
|
|
showInspector = true
|
2020-07-18 01:05:26 +02:00
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Get Info")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.getInfoImage
|
|
|
|
#endif
|
|
|
|
}
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Mark All As Read")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.markAllAsReadImage
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
Divider()
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Open Home Page")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.openInBrowserImage
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
Divider()
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Copy Feed URL")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.copyImage
|
|
|
|
#endif
|
|
|
|
}
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Copy Home Page URL")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.copyImage
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
Divider()
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Delete")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.deleteImage
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if sidebarItem.representedType == .folder {
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
2020-07-18 15:24:06 +02:00
|
|
|
showInspector = true
|
2020-07-18 01:05:26 +02:00
|
|
|
} label: {
|
2020-07-18 15:24:06 +02:00
|
|
|
Text("Get Info")
|
2020-07-18 00:34:11 +02:00
|
|
|
#if os(iOS)
|
2020-07-18 15:24:06 +02:00
|
|
|
AppAssets.getInfoImage
|
2020-07-18 00:34:11 +02:00
|
|
|
#endif
|
|
|
|
}
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 15:24:06 +02:00
|
|
|
Text("Mark All As Read")
|
2020-07-18 00:34:11 +02:00
|
|
|
#if os(iOS)
|
2020-07-18 15:24:06 +02:00
|
|
|
AppAssets.markAllAsReadImage
|
2020-07-18 00:34:11 +02:00
|
|
|
#endif
|
|
|
|
}
|
2020-07-18 15:24:06 +02:00
|
|
|
Divider()
|
2020-07-18 01:05:26 +02:00
|
|
|
Button {
|
|
|
|
} label: {
|
2020-07-18 00:34:11 +02:00
|
|
|
Text("Delete")
|
|
|
|
#if os(iOS)
|
|
|
|
AppAssets.deleteImage
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|