From c31830dceabe414f643a100ed837821f2f874e4f Mon Sep 17 00:00:00 2001 From: Tuchuanhuhuhu Date: Thu, 9 Feb 2023 11:27:46 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9F=90?= =?UTF-8?q?=E4=BA=9B=E6=83=85=E5=86=B5=E4=B8=8B=E4=BA=AE=E6=9A=97=E8=89=B2?= =?UTF-8?q?=E5=A3=81=E7=BA=B8=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChuanhuWallpaper.xcodeproj/project.pbxproj | 8 ++++---- ChuanhuWallpaper/Components/SaveButton.swift | 11 ++++++++--- ChuanhuWallpaper/Components/WallpaperCell.swift | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChuanhuWallpaper.xcodeproj/project.pbxproj b/ChuanhuWallpaper.xcodeproj/project.pbxproj index 8f7998c..46c9c5c 100644 --- a/ChuanhuWallpaper.xcodeproj/project.pbxproj +++ b/ChuanhuWallpaper.xcodeproj/project.pbxproj @@ -422,7 +422,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 14; + CURRENT_PROJECT_VERSION = 16; DEVELOPMENT_ASSET_PATHS = "\"ChuanhuWallpaper/Preview Content\""; DEVELOPMENT_TEAM = KWS26AWJ45; ENABLE_HARDENED_RUNTIME = YES; @@ -435,7 +435,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.1.1; PRODUCT_BUNDLE_IDENTIFIER = com.tuchuanhuhuhu.ChuanhuWallpaper; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -452,7 +452,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 14; + CURRENT_PROJECT_VERSION = 16; DEVELOPMENT_ASSET_PATHS = "\"ChuanhuWallpaper/Preview Content\""; DEVELOPMENT_TEAM = KWS26AWJ45; ENABLE_HARDENED_RUNTIME = YES; @@ -465,7 +465,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 2.0; + MARKETING_VERSION = 2.1.1; PRODUCT_BUNDLE_IDENTIFIER = com.tuchuanhuhuhu.ChuanhuWallpaper; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/ChuanhuWallpaper/Components/SaveButton.swift b/ChuanhuWallpaper/Components/SaveButton.swift index 434a19a..e86f11c 100644 --- a/ChuanhuWallpaper/Components/SaveButton.swift +++ b/ChuanhuWallpaper/Components/SaveButton.swift @@ -30,12 +30,17 @@ struct SaveButton: View { private func save() { var pictureInfos: [PictureInfo] = [] + var info: PictureInfo for wallpaper in wallpapers { // Skip wallpapers which are not for light or dark mode when current mode is appearance. - if mode == .appearance && wallpaper.isFor == .none { - continue + if mode == .appearance { + if wallpaper.isFor == .none { + continue + } + info = PictureInfo(fileName: wallpaper.filePath.path, isPrimary: wallpaper.isPrimary, isForLight: wallpaper.isFor == .light, isForDark: wallpaper.isFor == .dark, altitude: nil, azimuth: nil) + } else { + info = PictureInfo(fileName: wallpaper.filePath.path, isPrimary: wallpaper.isPrimary, isForLight: wallpaper.isFor == .light, isForDark: wallpaper.isFor == .dark, altitude: wallpaper.altitude, azimuth: wallpaper.azimuth) } - let info = PictureInfo(fileName: wallpaper.filePath.path, isPrimary: wallpaper.isPrimary, isForLight: wallpaper.isFor == .light, isForDark: wallpaper.isFor == .dark, altitude: wallpaper.altitude, azimuth: wallpaper.azimuth) pictureInfos.append(info) } if let outputFileName = showSavePanel() { diff --git a/ChuanhuWallpaper/Components/WallpaperCell.swift b/ChuanhuWallpaper/Components/WallpaperCell.swift index 0e20afb..944032e 100644 --- a/ChuanhuWallpaper/Components/WallpaperCell.swift +++ b/ChuanhuWallpaper/Components/WallpaperCell.swift @@ -72,7 +72,7 @@ struct WallpaperCell: View { .frame(maxWidth: 150, maxHeight: .infinity) .padding(10) .background( - Color.white + Color.backgroud .opacity(0.5) .overlay( RoundedRectangle(cornerRadius: 8)