forked from AparokshaUI/adwaita-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ToolbarDemo.swift
60 lines (49 loc) · 1.31 KB
/
ToolbarDemo.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// ToolbarDemo.swift
// Adwaita
//
// Created by david-swift on 12.10.23.
//
// swiftlint:disable missing_docs no_magic_numbers
import Adwaita
struct ToolbarDemo: View {
var app: GTUIApp
var view: Body {
VStack {
Button("View Demo") {
app.showWindow("toolbar-demo")
}
.suggested()
.pill()
.frame(maxWidth: 100)
}
}
struct WindowContent: View {
@State private var visible = false
@State private var moreContent = false
var view: Body {
VStack {
Button("Toggle Toolbar") {
visible.toggle()
}
.suggested()
.pill()
.frame(maxWidth: 100)
.padding(15)
}
.valign(.center)
.bottomToolbar(visible: visible) {
HeaderBar(titleButtons: false) {
Button(icon: .default(icon: .audioInputMicrophone)) { }
} end: {
Button(icon: .default(icon: .userTrash)) { }
}
.headerBarTitle { }
}
.topToolbar {
HeaderBar.empty()
}
}
}
}
// swiftlint:enable missing_docs no_magic_numbers