-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolbar.go
51 lines (48 loc) · 1.3 KB
/
toolbar.go
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
package main
import (
"log/slog"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
)
func makeToolbar(a fyne.App, w fyne.Window) fyne.CanvasObject {
return container.NewVBox(
widget.NewToolbar(
widget.NewToolbarAction(theme.FileIcon(), func() {
slog.Info("selected toolbar item New")
newFile(a, w)
}),
widget.NewToolbarAction(theme.FolderOpenIcon(), func() {
slog.Info("selected toolbar item Open")
openFile(a, w)
}),
widget.NewToolbarAction(theme.DocumentSaveIcon(), func() {
slog.Info("selected toolbar item Save")
saveFile(a, w)
}),
widget.NewToolbarSeparator(),
widget.NewToolbarAction(theme.MediaPlayIcon(), func() {
slog.Info("selected toolbar item Play")
play()
}),
widget.NewToolbarAction(theme.MediaPauseIcon(), func() {
slog.Info("selected toolbar item Pause")
pause()
}),
widget.NewToolbarAction(theme.MediaStopIcon(), func() {
slog.Info("selected toolbar item Stop")
stop()
}),
widget.NewToolbarAction(theme.MediaFastRewindIcon(), func() {
slog.Info("selected toolbar item Rewind")
rewind()
}),
widget.NewToolbarAction(theme.MediaFastForwardIcon(), func() {
slog.Info("selected toolbar item Forward")
forward()
}),
),
widget.NewSeparator(),
)
}