Skip to content

Commit

Permalink
Merge pull request PlayCover#61 from Wind-Explorer/feature/better-ui
Browse files Browse the repository at this point in the history
✨ much more cleaner & nicer UI
  • Loading branch information
Depal1 committed Jul 19, 2022
2 parents 4171c2a + 83b74c5 commit a87df8a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 55 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@ fastlane/test_output

iOSInjectionProject/
xcuserdata/*
PlayCover.xcodeproj/project.pbxproj
10 changes: 2 additions & 8 deletions PlayCover/View/AppsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,15 @@ struct AppsView : View {
}.padding(.leading, 30)
.help("Untick this option to show installed apps only")
Spacer()
SearchView().padding(.leading, 20).padding(.trailing, 10).padding(.vertical, 8)
ExportView().environmentObject(InstallVM.shared)
Button(NSLocalizedString("Download more apps", comment: "")) {
if let url = URL(string: "https://armconverter.com/decryptedappstore") {
if let url = URL(string: "https://ipa.playcover.workers.dev/0:/") {
NSWorkspace.shared.open(url)
}
}.buttonStyle(OutlineButton()).controlSize(.large).help(NSLocalizedString("Use this site to decrypt and download any global app", comment:""))
.padding(.trailing, 30)
}

HStack(alignment: .center){
Spacer()
SearchView().padding(.leading, 20).padding(.trailing, 25).padding(.vertical, 8)
// Image("Happy").resizable().frame(width: 64, height: 64).padding(.bottom, 0).padding(.trailing, 16) // "remove the damm cat" - Perseque
}.padding(.top, 0)
Divider().padding(.top, 0).padding(.horizontal, 36)
if !sh.isXcodeCliToolsInstalled {
VStack(spacing: 12) {
Text("You need to install Xcode Commandline tools and restart this App.")
Expand Down
42 changes: 16 additions & 26 deletions PlayCover/View/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,27 @@ struct MainView: View {
VStack(alignment: .leading, spacing: 0) {
HStack {
Text("Notices").font(.headline).help("Important news and announcements")
Spacer()
Button {
withAnimation { noticesExpanded.toggle() }
} label: {
Image(systemName: "chevron.down")
Image(systemName: "chevron.up")
.rotationEffect(Angle(degrees: noticesExpanded ? 180 : 0))
}
Spacer()
if !SystemConfig.isPlaySignActive {
HStack {
Button("Problems logging in?") { showSetup = true }
.buttonStyle(.borderedProminent).tint(.accentColor).controlSize(.large)
}
}
if !update.updateLink.isEmpty {
Button(action: { NSWorkspace.shared.open(URL(string: update.updateLink)!) }) {
HStack {
Image(systemName: "arrow.down.square.fill")
Text("Update app")
}
}.buttonStyle(UpdateButton()).controlSize(.large)
}
}
Text(StoreApp.notice)
.font(.body)
Expand All @@ -110,32 +124,8 @@ struct MainView: View {
.padding(.top, noticesExpanded ? 8 : 0)
}

Divider()
HStack(spacing: 12) {
Link("Join Discord Server", destination: URL(string: "https://discord.gg/rMv5qxGTGC")!)
.help("If you have some problem you always can visit our friendly community.")
.foregroundColor(.accentColor)
Spacer()
if !SystemConfig.isPlaySignActive {
Text("Having problems logging into apps?").font(.title3)
Button("Enable PlaySign") { showSetup = true }
.buttonStyle(.borderedProminent).tint(.accentColor).controlSize(.large)
Spacer()
}
Button(action: {
Log.shared.logdata.copyToClipBoard()
showToast.toggle()
}) {
Text("Copy logs")
}.controlSize(.large)
if !update.updateLink.isEmpty {
Button(action: { NSWorkspace.shared.open(URL(string: update.updateLink)!) }) {
HStack {
Image(systemName: "arrow.down.square.fill")
Text("Update app")
}
}.buttonStyle(UpdateButton()).controlSize(.large)
}
}.frame(maxWidth: .infinity)
#if DEBUG
Divider()
Expand Down
7 changes: 6 additions & 1 deletion PlayCover/View/PlayCoverApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct PlayCoverApp: App {
.environmentObject(InstallVM.shared)
.environmentObject(AppsVM.shared)
.environmentObject(AppIntegrity())
.frame(minWidth: 600, minHeight: 650)
.frame(minWidth: 720, minHeight: 650)
.onAppear {
UserDefaults.standard.register(defaults: ["ShowLinks" : true])
SoundDeviceService.shared.prepareSoundDevice()
Expand Down Expand Up @@ -77,6 +77,11 @@ struct PlayCoverApp: App {
NSWorkspace.shared.open(URL(string: "https://discord.gg/PlayCover")!)
}
}
CommandGroup(after: .systemServices) {
Button("Copy log") {
Log.shared.logdata.copyToClipBoard()
}
}
}
}

Expand Down
36 changes: 17 additions & 19 deletions PlayCover/View/SetupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,36 +56,35 @@ struct SetupView : View {
var body: some View {
VStack(alignment: .leading, spacing: 12) {
if !SystemConfig.isSIPDisabled() {
Text("A one-time setup is required to enable PlaySign")
Text("Are apps not allowing you to login?")
.padding([.horizontal, .top])
.font(.title)
Text("Please follow the following instructions:")
.font(.title.weight(.heavy))
Text("Follow the instructions below to fix exactly that!")
.padding(.horizontal)
.padding(.top, -4)

Divider()
Spacer()

VStack(alignment: .leading, spacing: 5) {
Group {
Text("1) Restart your Mac")
Text("2) Hold the power button when the screen turns black")
Text("1) Shutdown your Mac")
Text("2) Hold down the power button 10 seconds after the screen turns black")
Text("3) When \"Loading Startup Options\" appears below the Apple logo, release the power button")
Text("4) Click the Recovery Mode boot option")
Text("5) In Recovery, open Terminal (Utilities -> Terminal)")
HStack(spacing: 4) {
Text("6) Type: ")
Label {
Text("csrutil disable").textSelection(.enabled).font(.monospaced(.body)())
} icon: {
Image(systemName: "terminal")
}
.padding(.horizontal, 10)
.padding(.vertical, 8)
.background(RoundedRectangle(cornerRadius: 8).stroke(lineWidth: 1).foregroundColor(Colr.highlighted(Colr.isDarkMode())))
Text("csrutil disable").textSelection(.enabled).font(.monospaced(.body)())
.padding(.horizontal, 4)
.padding(.vertical, 2)
.background(Color(red: 0.25, green: 0.25, blue: 0.25))
.cornerRadius(5)
}
Text("7) Press Return or Enter on your keyboard. Input your Mac screen password (it is invisible)")
Text("8) Click the Apple symbol in the Menu bar and Restart")

Spacer()

Text("If you encounter any errors, restart and repeat the whole process again").font(.callout)
}

Expand All @@ -94,7 +93,7 @@ struct SetupView : View {
ZStack{
Link("YouTube", destination: URL(string: "https://www.youtube.com/watch?v=H3CoI84s_FI")!)
.font(.title3)
.padding(.vertical, 8).padding(.horizontal, 12)
.padding(.vertical, 4).padding(.horizontal, 10)
}
.background(
RoundedRectangle(cornerRadius: 8)
Expand All @@ -103,18 +102,17 @@ struct SetupView : View {
ZStack{
Link("Bilibili", destination: URL(string: "https://www.bilibili.com/video/BV1Th411q7Lt")!)
.font(.title3)
.padding(.vertical, 8).padding(.horizontal, 12)
.padding(.vertical, 4).padding(.horizontal, 10)
}
.background(
RoundedRectangle(cornerRadius: 8)
.fill(Color(NSColor.unemphasizedSelectedContentBackgroundColor))
)
}
.frame(maxWidth: .infinity)
.padding(4)
.padding(2)
}.padding(.top, 8)

Button("OK") { presentationMode.wrappedValue.dismiss() }
Button("Dismiss") { presentationMode.wrappedValue.dismiss() }
.padding([.top, .bottom])
.buttonStyle(.borderedProminent)
.controlSize(.large)
Expand Down
2 changes: 1 addition & 1 deletion PlayCover/View/Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct OutlineButton: ButtonStyle {
configuration
.label
.foregroundColor(configuration.isPressed ? .gray : .accentColor)
.padding(.vertical, 10.0).padding(.horizontal, 10.0)
.padding(.vertical, 8.0).padding(.horizontal, 10.0)
.background(
RoundedRectangle(
cornerRadius: 8,
Expand Down

0 comments on commit a87df8a

Please sign in to comment.