-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
43 lines (35 loc) · 942 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
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 (h *hgui) setProject(u fyne.URI) {
h.projectRoot = u
content := h.makeResultsPanel()
h.fileTree = h.makeFilesPanel()
mainSplit := container.NewHSplit(h.fileTree, content)
mainSplit.Offset = 0.2
h.win.SetMainMenu(h.makeMenu())
h.win.SetContent(container.NewBorder(h.makeToolbar(), nil, nil, nil, mainSplit))
}
func main() {
a := app.NewWithID("lu.circl.hashlookup-gui")
//a.SetIcon(resourceIconPng)
w := a.NewWindow("Hashlookup-gui")
w.Resize(fyne.NewSize(1024, 768))
hgui := &hgui{win: w, offlineMode: false, app: &a}
if len(os.Args) > 1 {
path, _ := filepath.Abs(os.Args[1])
root := storage.NewFileURI(path)
hgui.setProject(root)
} else {
root := defaultDir()
hgui.setProject(root)
}
hgui.Filter = NewHashlookupBloom("Empty filter", hgui)
w.ShowAndRun()
}