-
Notifications
You must be signed in to change notification settings - Fork 26
/
main.go
47 lines (37 loc) · 1005 Bytes
/
main.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
//go:generate fyne bundle -o bundled.go assets/folder-play.svg
//go:generate fyne bundle -a -o bundled.go Icon.png
package main
import (
"os"
"path/filepath"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/storage"
)
func (d *defyne) setProject(u fyne.URI) {
d.projectRoot = u
content := container.NewVSplit(d.makeEditorPanel(), d.makeTerminalPanel())
content.Offset = 0.8
d.fileTree = d.makeFilesPanel()
mainSplit := container.NewHSplit(d.fileTree, content)
mainSplit.Offset = 0.2
d.win.SetMainMenu(d.makeMenu())
d.win.SetContent(container.NewBorder(d.makeToolbar(), nil, nil, nil, mainSplit))
}
func main() {
a := app.NewWithID("io.fyne.defyne")
a.SetIcon(resourceIconPng)
w := a.NewWindow("Defyne")
w.Resize(fyne.NewSize(1024, 768))
ide := &defyne{win: w}
if len(os.Args) > 1 {
path, _ := filepath.Abs(os.Args[1])
root := storage.NewFileURI(path)
ide.setProject(root)
w.Show()
} else {
ide.showProjectSelect()
}
a.Run()
}