Skip to content

Commit

Permalink
Fix a few UI Issues (#438)
Browse files Browse the repository at this point in the history
* Fix a few UI Issues

* SwiftLint

* More slight UI tweaks
  • Loading branch information
IsaacMarovitz committed Oct 25, 2022
1 parent 4e3a28a commit 0b4df8c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
38 changes: 18 additions & 20 deletions PlayCover/Views/App Views/PlayAppView.swift
Expand Up @@ -240,27 +240,25 @@ struct PlayAppConditionalView: View {
}
.frame(width: 60, height: 60)

HStack {
let noPlayToolsWarning = Text(
app.hasPlayTools ? "" : "\(Image(systemName: "exclamationmark.triangle")) "
)
let noPlayToolsWarning = Text(
app.hasPlayTools ? "" : "\(Image(systemName: "exclamationmark.triangle")) "
)

Text("\(noPlayToolsWarning)\(app.name)")
.lineLimit(1)
.multilineTextAlignment(.center)
.padding(.horizontal, 4)
.padding(.vertical, 2)
.foregroundColor(selected?.info.bundleIdentifier == app.info.bundleIdentifier ?
selectedTextColor : Color.primary)
.background(
RoundedRectangle(cornerRadius: 4)
.fill(selected?.info.bundleIdentifier == app.info.bundleIdentifier ?
selectedBackgroundColor : Color.clear)
.brightness(-0.2)
)
.help("settings.noPlayTools")
.fixedSize()
}
Text("\(noPlayToolsWarning)\(app.name)")
.lineLimit(1)
.multilineTextAlignment(.center)
.padding(.horizontal, 4)
.padding(.vertical, 2)
.foregroundColor(selected?.info.bundleIdentifier == app.info.bundleIdentifier ?
selectedTextColor : Color.primary)
.background(
RoundedRectangle(cornerRadius: 4)
.fill(selected?.info.bundleIdentifier == app.info.bundleIdentifier ?
selectedBackgroundColor : Color.clear)
.brightness(-0.2)
)
.help("settings.noPlayTools")
.frame(width: 130, height: 20)
}
.frame(width: 130, height: 130)
}
Expand Down
14 changes: 10 additions & 4 deletions PlayCover/Views/AppSettingsView.swift
Expand Up @@ -43,10 +43,12 @@ struct AppSettingsView: View {
Spacer()
}

let noPlayToolsWarning = Image(systemName: "exclamationmark.triangle")
let warning = NSLocalizedString("settings.noPlayTools", comment: "")

if !viewModel.app.hasPlayTools {
HStack(spacing: 3) {
Image(systemName: "exclamationmark.triangle")
Text(NSLocalizedString("settings.noPlayTools", comment: ""))
HStack {
Text("\(noPlayToolsWarning) \(warning)")
.font(.caption)
.multilineTextAlignment(.leading)
Spacer()
Expand Down Expand Up @@ -248,6 +250,8 @@ struct GraphicsView: View {
Text("settings.text.detectedResolution")
Spacer()
Text("\(width) x \(height)")
} else {
Spacer()
}
}
HStack {
Expand Down Expand Up @@ -373,6 +377,7 @@ struct MiscView: View {
VStack {
HStack {
Toggle("settings.toggle.discord", isOn: $settings.settings.discordActivity.enable)
Spacer()
Button("settings.button.discord") { showPopover = true }
.popover(isPresented: $showPopover, arrowEdge: .bottom) {
VStack {
Expand Down Expand Up @@ -412,14 +417,15 @@ struct MiscView: View {
}.padding(.bottom)
}
}
Spacer()
}.disabled(!app.hasPlayTools)
if #available(macOS 13.0, *) {
HStack {
Toggle("settings.toggle.hud", isOn: $settings.metalHudEnabled)
Spacer()
}
}
Spacer()
.frame(height: 20)
HStack {
Button(app.hasPlayTools ? "settings.removePlayTools" : "alert.install.injectPlayTools") {
if app.hasPlayTools {
Expand Down

0 comments on commit 0b4df8c

Please sign in to comment.