Skip to content

Commit

Permalink
Tweak alert views
Browse files Browse the repository at this point in the history
tekezo committed Sep 18, 2023
1 parent 85458a4 commit 9071547
Showing 2 changed files with 52 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -36,13 +36,15 @@ struct DriverNotActivatedAlertView: View {
.frame(height: 300)
.border(Color.gray, width: 1)

Button(
action: { showingAdvanced = true },
label: {
Label(
"If the Allow button is not displayed on Privacy & Security.",
systemImage: "questionmark.circle")
})
if !showingAdvanced {
Button(
action: { showingAdvanced = true },
label: {
Label(
"If the Allow button is not displayed on Privacy & Security.",
systemImage: "questionmark.circle")
})
}
}.padding()
}.frame(width: showingAdvanced ? 400 : 800)

Original file line number Diff line number Diff line change
@@ -1,36 +1,62 @@
import SwiftUI

struct DriverVersionMismatchedAlertView: View {
@State private var showingAdvanced = false

var body: some View {
ZStack(alignment: .topLeading) {
VStack(alignment: .leading, spacing: 20.0) {
Label(
"Driver Alert",
systemImage: "exclamationmark.triangle"
"macOS restart required",
systemImage: "lightbulb"
)
.font(.system(size: 24))

Text(
"The current virtual keyboard and mouse driver is outdated.\nPlease deactivate driver and restart macOS to upgrade the driver."
)
.fixedSize(horizontal: false, vertical: true)

Text("How to upgrade the driver:")
VStack(alignment: .leading, spacing: 0) {
Text(
"The current virtual keyboard and mouse driver is outdated."
)

VStack(alignment: .leading, spacing: 10.0) {
Text(
"1. Press the following button to deactivate driver.\n(The administrator password will be required.)"
"Please restart macOS to upgrade the driver."
)
.fixedSize(horizontal: false, vertical: true)
.fontWeight(.bold)
}

if !showingAdvanced {
Button(
action: { showingAdvanced = true },
label: {
Label(
"If this message still appears after restarting macOS.",
systemImage: "questionmark.circle")
}
)
}

if showingAdvanced {
GroupBox(label: Text("Advanced")) {
VStack(alignment: .leading, spacing: 10.0) {
Text(
"If you continue to get this message after restarting macOS, try deactivating the virtual driver once by the following steps."
)

DeactivateDriverButton()
.padding(.vertical, 10)
.padding(.leading, 20)
VStack(alignment: .leading, spacing: 10.0) {
Text(
"1. Press the following button to deactivate driver.\n(The administrator password will be required.)"
)
.fixedSize(horizontal: false, vertical: true)

Text("2. Restart macOS.")
.fontWeight(.bold)
DeactivateDriverButton()
.padding(.vertical, 10)
.padding(.leading, 20)

Text("3. Activate the driver after restarting macOS.")
Text("2. Restart macOS.")
.fontWeight(.bold)
}
}
.padding()
}
}
}
.padding()

0 comments on commit 9071547

Please sign in to comment.