-
Notifications
You must be signed in to change notification settings - Fork 0
/
toolbar.go
40 lines (37 loc) · 1.04 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
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.ContentAddIcon(), func() {
slog.Info("selected toolbar item Add")
newValue(a, w)
}),
widget.NewToolbarAction(theme.ContentRemoveIcon(), func() {
slog.Info("selected toolbar item Delete")
deleteSelected()
}),
widget.NewToolbarAction(theme.DocumentCreateIcon(), func() {
slog.Info("selected toolbar item Edit")
editSelected(w)
}),
), widget.NewSeparator())
}