|
@@ -4,6 +4,16 @@ import SwiftUI
|
|
|
private let formsAccent = Color(red: 0.45, green: 0.28, blue: 0.72)
|
|
private let formsAccent = Color(red: 0.45, green: 0.28, blue: 0.72)
|
|
|
private let formsPanelBg = Color(red: 0.09, green: 0.08, blue: 0.14)
|
|
private let formsPanelBg = Color(red: 0.09, green: 0.08, blue: 0.14)
|
|
|
|
|
|
|
|
|
|
+/// Distinct Google entry points so Form / Quiz / Survey are not identical redirects.
|
|
|
|
|
+private enum FormsCreateURL {
|
|
|
|
|
+ /// Blank form (Google `.new` shortcut).
|
|
|
|
|
+ static let blankForm = "https://forms.new"
|
|
|
|
|
+ /// Quiz-focused create flow (official short link).
|
|
|
|
|
+ static let quiz = "https://g.co/createaquiz"
|
|
|
|
|
+ /// Template gallery filtered to Forms — pick survey, RSVP, feedback, etc.
|
|
|
|
|
+ static let surveyTemplates = "https://docs.google.com/templates?type=forms"
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/// Large Google Forms dashboard: find + create shortcuts (opens real Forms URLs in-app).
|
|
/// Large Google Forms dashboard: find + create shortcuts (opens real Forms URLs in-app).
|
|
|
struct FormsDesktopWidgetView: View {
|
|
struct FormsDesktopWidgetView: View {
|
|
|
let app: LauncherApp
|
|
let app: LauncherApp
|
|
@@ -97,14 +107,14 @@ struct FormsDesktopWidgetView: View {
|
|
|
VStack(alignment: .leading, spacing: 6) {
|
|
VStack(alignment: .leading, spacing: 6) {
|
|
|
sectionLabel("Create")
|
|
sectionLabel("Create")
|
|
|
HStack(spacing: 6) {
|
|
HStack(spacing: 6) {
|
|
|
- createPill(title: "Form", systemImage: "doc.badge.plus", urlString: "https://docs.google.com/forms/create")
|
|
|
|
|
- createPill(title: "Quiz", systemImage: "checkmark.circle.fill", urlString: "https://docs.google.com/forms/u/0/create")
|
|
|
|
|
- createPill(title: "Survey", systemImage: "chart.bar.doc.horizontal", urlString: "https://docs.google.com/forms/u/0/create?usp=forms_home")
|
|
|
|
|
|
|
+ createPill(title: "Form", systemImage: "doc.badge.plus", urlString: FormsCreateURL.blankForm, help: "New blank form (forms.new)")
|
|
|
|
|
+ createPill(title: "Quiz", systemImage: "checkmark.circle.fill", urlString: FormsCreateURL.quiz, help: "Start a quiz (g.co/createaquiz)")
|
|
|
|
|
+ createPill(title: "Survey", systemImage: "chart.bar.doc.horizontal", urlString: FormsCreateURL.surveyTemplates, help: "Form templates including surveys")
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private func createPill(title: String, systemImage: String, urlString: String) -> some View {
|
|
|
|
|
|
|
+ private func createPill(title: String, systemImage: String, urlString: String, help: String) -> some View {
|
|
|
Button {
|
|
Button {
|
|
|
openAbsolute(urlString)
|
|
openAbsolute(urlString)
|
|
|
} label: {
|
|
} label: {
|
|
@@ -124,6 +134,7 @@ struct FormsDesktopWidgetView: View {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
.buttonStyle(.plain)
|
|
.buttonStyle(.plain)
|
|
|
|
|
+ .help(help)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private func sectionLabel(_ text: String) -> some View {
|
|
private func sectionLabel(_ text: String) -> some View {
|