This commit is contained in:
anlicheng 2026-03-20 00:47:01 +08:00
parent 41cacb7134
commit c02a2ca4ea
2 changed files with 32 additions and 18 deletions

View File

@ -63,6 +63,8 @@ struct LoginView: View {
Spacer() Spacer()
// //
HStack(spacing: 4) { HStack(spacing: 4) {
Circle() Circle()
@ -101,6 +103,14 @@ struct LoginAccountView: View {
VStack(alignment: .trailing, spacing: 4) { VStack(alignment: .trailing, spacing: 4) {
CustomSecureField(title: "密码", text: $password, icon: "lock.fill") CustomSecureField(title: "密码", text: $password, icon: "lock.fill")
HStack {
Button("注册") {
openWindow(id: "register")
}
.buttonStyle(.link)
.font(.system(size: 11))
.foregroundColor(.secondary)
Button("忘记密码?") { Button("忘记密码?") {
openWindow(id: "resetPassword") openWindow(id: "resetPassword")
} }
@ -109,6 +119,7 @@ struct LoginAccountView: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
} }
}
.frame(width: 280) .frame(width: 280)
// //

View File

@ -55,15 +55,15 @@ struct punchnetApp: App {
.environment(self.appContext) .environment(self.appContext)
.environment(self.userContext) .environment(self.userContext)
} }
.commands { // .commands {
CommandGroup(replacing: .appInfo) { // CommandGroup(replacing: .appInfo) {
Button { // Button {
openWindow(id: "abortPunchnet") // openWindow(id: "abortPunchnet")
} label: { // } label: {
Text("About Punchnet") // Text("About Punchnet")
} // }
} // }
} // }
.windowResizability(.contentSize) .windowResizability(.contentSize)
.windowToolbarStyle(.unified) .windowToolbarStyle(.unified)
.defaultPosition(.center) .defaultPosition(.center)
@ -72,24 +72,27 @@ struct punchnetApp: App {
SettingsView() SettingsView()
.environment(self.userContext) .environment(self.userContext)
.environment(self.appContext) .environment(self.appContext)
.frame(width: 750, height: 500)
} }
//.defaultSize(width: 800, height: 500) .windowResizability(.contentSize)
.defaultPosition(.center) .defaultPosition(.center)
Window("重置密码", id: "resetPassword") { Window("重置密码", id: "resetPassword") {
ResetPasswordRootView() ResetPasswordRootView()
.environment(self.userContext) .environment(self.userContext)
.environment(self.appContext) .environment(self.appContext)
.frame(width: 750, height: 500)
} }
.defaultSize(width: 800, height: 500) .windowResizability(.contentSize)
.defaultPosition(.center) .defaultPosition(.center)
Window("注册", id: "register") { Window("注册", id: "register") {
ResetPasswordRootView() RegisterRootView()
.environment(self.userContext) .environment(self.userContext)
.environment(self.appContext) .environment(self.appContext)
.frame(width: 750, height: 500)
} }
.defaultSize(width: 800, height: 500) .windowResizability(.contentSize)
.defaultPosition(.center) .defaultPosition(.center)
MenuBarExtra("punchnet", image: "logo_32") { MenuBarExtra("punchnet", image: "logo_32") {