Skip to content

Commit

Permalink
UI Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
underthestars-zhy committed May 9, 2022
1 parent 31cd536 commit 122896c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
8 changes: 4 additions & 4 deletions IconChanger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"IconChanger/Preview Content\"";
DEVELOPMENT_TEAM = 44BN78992X;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -344,7 +344,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.1.1;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.zhuhaoyu.IconChanger;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -362,7 +362,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"IconChanger/Preview Content\"";
DEVELOPMENT_TEAM = 44BN78992X;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -375,7 +375,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.1.1;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.zhuhaoyu.IconChanger;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
36 changes: 27 additions & 9 deletions IconChanger/ChangeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,40 @@ struct ChangeView: View {
GridItem(.flexible(), alignment: .top)]

@State var icons: [URL] = []
@State var inIcons: [URL] = []
let setPath: String

@Environment(\.presentationMode) var presentationMode

var body: some View {
ScrollView(showsIndicators: false) {
LazyVGrid(columns: rules) {
ForEach(icons, id: \.self) { icon in
ImageView(url: icon, setPath: setPath)
TabView {
ScrollView(showsIndicators: false) {
LazyVGrid(columns: rules) {
ForEach(icons, id: \.self) { icon in
ImageView(url: icon, setPath: setPath)
}

Spacer()
}
}
.tabItem {
Text("macOSIcon")
}

Spacer()
ScrollView(showsIndicators: false) {
LazyVGrid(columns: rules) {
ForEach(inIcons, id: \.self) { icon in
ImageView(url: icon, setPath: setPath)
}

Spacer()
}
}
.tabItem {
Text("Local")
}
.padding()
}
.padding()
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") {
Expand All @@ -38,11 +57,10 @@ struct ChangeView: View {
}
.frame(width: 500, height: 400)
.task {
icons = IconManager.shared.getIconInPath(setPath)
print(icons)
inIcons = IconManager.shared.getIconInPath(setPath)
let name = IconManager.shared.getAppName(setPath)
do {
icons += try await MyQueryRequestController().sendRequest(name)
icons = try await MyQueryRequestController().sendRequest(name)
} catch {
print(error)
}
Expand Down

0 comments on commit 122896c

Please sign in to comment.