diff options
author | Nick White <git@njw.name> | 2021-12-20 15:05:09 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2021-12-20 15:05:09 +0000 |
commit | 6ea3243f252bc4944c566a457da227a65639ecc7 (patch) | |
tree | 9559741802bc23a4313098925eb001d991c5c9a0 /cmd/rescribe | |
parent | 811075e32aa81df11f4d54fe0f5f315f4422d43c (diff) |
rescribe: Improve layout of gui, and make dir entry box read only
Diffstat (limited to 'cmd/rescribe')
-rw-r--r-- | cmd/rescribe/gui.go | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cmd/rescribe/gui.go b/cmd/rescribe/gui.go index eb91a49..ce142fc 100644 --- a/cmd/rescribe/gui.go +++ b/cmd/rescribe/gui.go @@ -102,6 +102,7 @@ func startGui(log log.Logger, cmd string, training string, systess bool, tessdir myWindow.Resize(fyne.NewSize(800, 400)) var gobtn *widget.Button + var fullContent *fyne.Container dir := widget.NewLabel("") @@ -112,22 +113,28 @@ func startGui(log log.Logger, cmd string, training string, systess bool, tessdir if err == nil && uri != nil { dir.SetText(uri.Path()) dirIcon.SetResource(theme.FolderIcon()) + myWindow.SetContent(fullContent) gobtn.Enable() } }, myWindow) }) - pdfBtn := widget.NewButtonWithIcon("Choose PDF", theme.FileTextIcon(), func() { + pdfBtn := widget.NewButtonWithIcon("Choose PDF", theme.DocumentIcon(), func() { dialog.ShowFileOpen(func(uri fyne.URIReadCloser, err error) { if err == nil && uri != nil { uri.Close() dir.SetText(uri.URI().Path()) - dirIcon.SetResource(theme.FileTextIcon()) + dirIcon.SetResource(theme.DocumentIcon()) + myWindow.SetContent(fullContent) gobtn.Enable() } }, myWindow) }) + gbookBtn := widget.NewButtonWithIcon("Get Google Book", theme.SearchIcon(), func() { + // TODO + }) + progressBar := widget.NewProgressBar() logarea := widget.NewMultiLineEntry() @@ -193,13 +200,14 @@ func startGui(log log.Logger, cmd string, training string, systess bool, tessdir }) gobtn.Disable() - choices := container.New(layout.NewGridLayout(2), folderBtn, pdfBtn) + choices := container.New(layout.NewGridLayout(3), folderBtn, pdfBtn, gbookBtn) chosen := container.New(layout.NewBorderLayout(nil, nil, dirIcon, nil), dirIcon, dir) - content := container.NewVBox(choices, chosen, gobtn, progressBar, logarea) + fullContent = container.NewVBox(choices, chosen, gobtn, progressBar, logarea) + startContent := container.NewVBox(choices, gobtn, progressBar, logarea) - myWindow.SetContent(content) + myWindow.SetContent(startContent) myWindow.Show() myApp.Run() |