From 55c1bde549ff9ce953bfc19c9aa7ad096330e2e4 Mon Sep 17 00:00:00 2001 From: Tuchuanhuhuhu Date: Fri, 13 Jan 2023 18:08:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=AE=E6=9A=97=E8=89=B2?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=8F=90=E4=BA=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChuanhuWallpaper.xcodeproj/project.pbxproj | 4 ++-- ChuanhuWallpaper/AppearanceWallpaperView.swift | 2 +- ChuanhuWallpaper/SolarWallpaperView.swift | 2 +- ChuanhuWallpaper/SubmitButton.swift | 3 ++- ChuanhuWallpaper/TimeWallpaperView.swift | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChuanhuWallpaper.xcodeproj/project.pbxproj b/ChuanhuWallpaper.xcodeproj/project.pbxproj index 00cef5a..d084acf 100644 --- a/ChuanhuWallpaper.xcodeproj/project.pbxproj +++ b/ChuanhuWallpaper.xcodeproj/project.pbxproj @@ -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; @@ -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; diff --git a/ChuanhuWallpaper/AppearanceWallpaperView.swift b/ChuanhuWallpaper/AppearanceWallpaperView.swift index 437497c..6f83f71 100644 --- a/ChuanhuWallpaper/AppearanceWallpaperView.swift +++ b/ChuanhuWallpaper/AppearanceWallpaperView.swift @@ -58,7 +58,7 @@ struct AppearanceWallpaperView: View { } } .padding() - SubmitButton(wallpapers: wallpapers) + SubmitButton(wallpapers: wallpapers, disableSubmit: currentSelectedNum < 2) .padding(.bottom) } } diff --git a/ChuanhuWallpaper/SolarWallpaperView.swift b/ChuanhuWallpaper/SolarWallpaperView.swift index 6365b03..67497ac 100644 --- a/ChuanhuWallpaper/SolarWallpaperView.swift +++ b/ChuanhuWallpaper/SolarWallpaperView.swift @@ -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() diff --git a/ChuanhuWallpaper/SubmitButton.swift b/ChuanhuWallpaper/SubmitButton.swift index 7358a02..e0bbbda 100644 --- a/ChuanhuWallpaper/SubmitButton.swift +++ b/ChuanhuWallpaper/SubmitButton.swift @@ -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 { @@ -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) } } diff --git a/ChuanhuWallpaper/TimeWallpaperView.swift b/ChuanhuWallpaper/TimeWallpaperView.swift index 88d7bb1..dd82f30 100644 --- a/ChuanhuWallpaper/TimeWallpaperView.swift +++ b/ChuanhuWallpaper/TimeWallpaperView.swift @@ -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() }