Skip to content

Commit

Permalink
bug修复:某些情况下亮暗色壁纸失效
Browse files Browse the repository at this point in the history
  • Loading branch information
GaiZhenbiao committed Feb 9, 2023
1 parent 1a920dc commit c31830d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ChuanhuWallpaper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
11 changes: 8 additions & 3 deletions ChuanhuWallpaper/Components/SaveButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion ChuanhuWallpaper/Components/WallpaperCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct WallpaperCell<Actions: View>: View {
.frame(maxWidth: 150, maxHeight: .infinity)
.padding(10)
.background(
Color.white
Color.backgroud
.opacity(0.5)
.overlay(
RoundedRectangle(cornerRadius: 8)
Expand Down

0 comments on commit c31830d

Please sign in to comment.