Polish demo app
This commit is contained in:
parent
932e4aeb8c
commit
212af591f1
@ -20,6 +20,7 @@ struct AlertDialogDemo: View {
|
||||
dialog = true
|
||||
}
|
||||
.style("pill")
|
||||
.style("suggested-action")
|
||||
.frame(maxWidth: 100)
|
||||
.padding()
|
||||
}
|
||||
|
||||
@ -100,35 +100,35 @@ struct Demo: App {
|
||||
}
|
||||
}
|
||||
} content: {
|
||||
StatusPage(
|
||||
selection.label,
|
||||
icon: selection.icon,
|
||||
description: selection.description
|
||||
) { selection.view(app: app, window: window, toast: toast, pictureURL: pictureURL) }
|
||||
.topToolbar {
|
||||
HeaderBar {
|
||||
Toggle(icon: .default(icon: .sidebarShow), isOn: $sidebarVisible)
|
||||
.tooltip("Toggle Sidebar")
|
||||
} end: {
|
||||
if sidebarVisible {
|
||||
Text("")
|
||||
.transition(.crossfade)
|
||||
} else {
|
||||
menu
|
||||
.transition(.crossfade)
|
||||
}
|
||||
}
|
||||
.headerBarTitle {
|
||||
if sidebarVisible {
|
||||
Text("")
|
||||
.transition(.crossfade)
|
||||
} else {
|
||||
WindowTitle(subtitle: "Demo", title: selection.label)
|
||||
.transition(.crossfade)
|
||||
ViewStack(element: selection) { selection in
|
||||
StatusPage(
|
||||
selection.label,
|
||||
icon: selection.icon,
|
||||
description: selection.description
|
||||
) { selection.view(app: app, window: window, toast: toast, pictureURL: pictureURL) }
|
||||
.topToolbar {
|
||||
HeaderBar {
|
||||
Toggle(icon: .default(icon: .sidebarShow), isOn: $sidebarVisible)
|
||||
.tooltip("Toggle Sidebar")
|
||||
} end: {
|
||||
if sidebarVisible {
|
||||
Text("").transition(.crossfade)
|
||||
} else {
|
||||
menu.transition(.crossfade)
|
||||
}
|
||||
}
|
||||
.headerBarTitle {
|
||||
if sidebarVisible {
|
||||
Text("")
|
||||
.transition(.crossfade)
|
||||
} else {
|
||||
WindowTitle(subtitle: "Demo", title: selection.label)
|
||||
.transition(.crossfade)
|
||||
}
|
||||
}
|
||||
}
|
||||
.toast("This is a toast!", signal: toast)
|
||||
}
|
||||
.toast("This is a toast!", signal: toast)
|
||||
}
|
||||
.aboutDialog(
|
||||
visible: $about,
|
||||
|
||||
@ -22,6 +22,7 @@ struct DialogDemo: View {
|
||||
dialog = true
|
||||
}
|
||||
.style("pill")
|
||||
.style("suggested-action")
|
||||
.frame(maxWidth: 100)
|
||||
.padding()
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ struct FormDemo: View {
|
||||
app.showWindow("form-demo")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.style("pill")
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,11 +23,9 @@ struct IdleDemo: View {
|
||||
.valign(.center)
|
||||
.frame(maxWidth: maxWidth)
|
||||
Button("Play") {
|
||||
activeProcess = true
|
||||
progress = 0
|
||||
Task {
|
||||
Idle {
|
||||
activeProcess = true
|
||||
progress = 0
|
||||
}
|
||||
Idle(delay: .seconds(delayFactor / max)) {
|
||||
progress += 1
|
||||
let done = progress == max
|
||||
|
||||
@ -19,6 +19,7 @@ struct NavigationViewDemo: View {
|
||||
app.showWindow("navigation")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.style("pill")
|
||||
.frame(maxWidth: 100)
|
||||
.padding()
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
import Adwaita
|
||||
import Foundation
|
||||
|
||||
enum Page: String, Identifiable, CaseIterable, Codable {
|
||||
enum Page: String, Identifiable, CaseIterable, Codable, CustomStringConvertible {
|
||||
|
||||
case welcome
|
||||
case counter
|
||||
|
||||
@ -19,6 +19,7 @@ struct PopoverDemo: View {
|
||||
visible = true
|
||||
}
|
||||
.style("suggested-action")
|
||||
.style("pill")
|
||||
.frame(maxWidth: 100)
|
||||
.popover(visible: $visible) {
|
||||
CounterDemo()
|
||||
|
||||
@ -19,6 +19,7 @@ struct ToastDemo: View {
|
||||
toast.signal()
|
||||
}
|
||||
.style("suggested-action")
|
||||
.style("pill")
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ struct ToolbarDemo: View {
|
||||
app.showWindow("toolbar-demo")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.style("pill")
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
@ -34,6 +35,7 @@ struct ToolbarDemo: View {
|
||||
visible.toggle()
|
||||
}
|
||||
.style("suggested-action")
|
||||
.style("pill")
|
||||
.frame(maxWidth: 100)
|
||||
.padding(15)
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ struct ViewSwitcherDemo: View {
|
||||
app.showWindow("switcher-demo")
|
||||
}
|
||||
.style("suggested-action")
|
||||
.style("pill")
|
||||
.frame(maxWidth: 100)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user