mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-15 12:22:06 +00:00
Review upgrade icons (#1141)
- Add to "General" module on macOS - Restore in profiles list/grid, removed in #1139
This commit is contained in:
parent
6ba8b32bef
commit
91823f1572
@ -121,6 +121,10 @@ private struct MarkerView: View {
|
||||
ZStack {
|
||||
ThemeImage(profileId == nextProfileId ? .pending : tunnel.statusImageName)
|
||||
.opaque(requiredFeatures == nil && (profileId == nextProfileId || profileId == tunnel.currentProfile?.id))
|
||||
|
||||
if let requiredFeatures {
|
||||
PurchaseRequiredView(features: requiredFeatures)
|
||||
}
|
||||
}
|
||||
.frame(width: 24)
|
||||
}
|
||||
|
@ -51,8 +51,13 @@ struct ModuleListView: View, Routable {
|
||||
var body: some View {
|
||||
List(selection: $selectedModuleId) {
|
||||
Section {
|
||||
NavigationLink(Strings.Global.Nouns.general, value: ProfileSplitView.Detail.general)
|
||||
.tag(Self.generalModuleId)
|
||||
NavigationLink(value: ProfileSplitView.Detail.general) {
|
||||
HStack {
|
||||
Text(Strings.Global.Nouns.general)
|
||||
PurchaseRequiredView(features: requiredGeneralFeatures)
|
||||
}
|
||||
}
|
||||
.tag(Self.generalModuleId)
|
||||
}
|
||||
Group {
|
||||
ForEach(profileEditor.modules, id: \.id) { module in
|
||||
@ -116,6 +121,17 @@ private extension ModuleListView {
|
||||
}
|
||||
|
||||
private extension ModuleListView {
|
||||
var requiredGeneralFeatures: Set<AppFeature> {
|
||||
var features: Set<AppFeature> = []
|
||||
if profileEditor.isShared {
|
||||
features.insert(.sharing)
|
||||
}
|
||||
if profileEditor.isAvailableForTV {
|
||||
features.insert(.appleTV)
|
||||
}
|
||||
return features
|
||||
}
|
||||
|
||||
func moveModules(from offsets: IndexSet, to newOffset: Int) {
|
||||
profileEditor.moveModules(from: offsets, to: newOffset)
|
||||
// XXX: selection is lost after move, reset as a workaround
|
||||
|
Loading…
Reference in New Issue
Block a user