Skip to content

Commit

Permalink
修复亮暗色模式提交按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
GaiZhenbiao committed Jan 13, 2023
1 parent be3f5cd commit 55c1bde
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ChuanhuWallpaper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
CODE_SIGN_ENTITLEMENTS = ChuanhuWallpaper/ChuanhuWallpaper.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_ASSET_PATHS = "\"ChuanhuWallpaper/Preview Content\"";
DEVELOPMENT_TEAM = KWS26AWJ45;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -369,7 +369,7 @@
CODE_SIGN_ENTITLEMENTS = ChuanhuWallpaper/ChuanhuWallpaper.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_ASSET_PATHS = "\"ChuanhuWallpaper/Preview Content\"";
DEVELOPMENT_TEAM = KWS26AWJ45;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down
2 changes: 1 addition & 1 deletion ChuanhuWallpaper/AppearanceWallpaperView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct AppearanceWallpaperView: View {
}
}
.padding()
SubmitButton(wallpapers: wallpapers)
SubmitButton(wallpapers: wallpapers, disableSubmit: currentSelectedNum < 2)
.padding(.bottom)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ChuanhuWallpaper/SolarWallpaperView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct SolarWallpaperView: View {
} label: {
Label("Add New Picture", systemImage: "doc.badge.plus")
}
SubmitButton(wallpapers: wallpapers)
SubmitButton(wallpapers: wallpapers, disableSubmit: wallpapers.count < 2)

HelpButton {
self.showPopover.toggle()
Expand Down
3 changes: 2 additions & 1 deletion ChuanhuWallpaper/SubmitButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct SubmitButton: View {
@State var showErrorMessage = false
@State var errorMessage = ""
let wallpaperGenerator = WallpaperGenerator()
var disableSubmit = false

var body: some View {
Button {
Expand Down Expand Up @@ -41,7 +42,7 @@ struct SubmitButton: View {
.alert(isPresented: $showErrorMessage) {
Alert(title: Text("An Error Occured"), message: Text(errorMessage), dismissButton: .cancel())
}
.disabled(wallpapers.count<2)
.disabled(disableSubmit)
}
}

Expand Down
2 changes: 1 addition & 1 deletion ChuanhuWallpaper/TimeWallpaperView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct TimeWallpaperView: View {
} label: {
Label("Add New Picture", systemImage: "doc.badge.plus")
}
SubmitButton(wallpapers: wallpapers)
SubmitButton(wallpapers: wallpapers, disableSubmit: wallpapers.count < 2)
HelpButton {
self.showPopover.toggle()
}
Expand Down

0 comments on commit 55c1bde

Please sign in to comment.