Skip to content

Commit 5727f06

Browse files
committed
Update UI
1 parent 9436e65 commit 5727f06

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

Mango.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@
809809
repositoryURL = "https://github.com/daemooon/Tun2SocksKit.git";
810810
requirement = {
811811
kind = exactVersion;
812-
version = 2.1.6;
812+
version = 2.1.10;
813813
};
814814
};
815815
/* End XCRemoteSwiftPackageReference section */

Mango.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mango/Home/MGConfigurationView.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ struct MGConfigurationView: View {
2424
Spacer()
2525
}
2626
} else {
27-
ForEach(configurationListManager.configurations) { configuration in
27+
ForEach(Array(configurationListManager.configurations.enumerated()), id: \.element.id) { pair in
2828
Button {
29-
guard current.wrappedValue != configuration.id else {
29+
guard current.wrappedValue != pair.element.id else {
3030
return
3131
}
32-
current.wrappedValue = configuration.id
32+
current.wrappedValue = pair.element.id
3333
guard let status = packetTunnelManager.status, status == .connected else {
3434
return
3535
}
@@ -42,15 +42,14 @@ struct MGConfigurationView: View {
4242
}
4343
} label: {
4444
Label {
45-
HStack {
46-
Text(configuration.attributes.alias)
47-
.foregroundColor(.primary)
48-
.lineLimit(1)
49-
}
45+
Text(pair.element.attributes.alias)
46+
.lineLimit(1)
5047
} icon: {
51-
Image(systemName: "arrow.right")
52-
.opacity(current.wrappedValue == configuration.id ? 1.0 : 0.0)
48+
Text("\(pair.offset + 1)")
49+
.lineLimit(1)
50+
.monospacedDigit()
5351
}
52+
.foregroundColor(current.wrappedValue == pair.element.id ? .accentColor : .primary)
5453
}
5554
}
5655
}

0 commit comments

Comments
 (0)