go fmt sources & add command-line file loading

This commit is contained in:
Luke I. Wilson
2021-03-11 14:11:43 -06:00
parent d0bb43cc8f
commit 443070f077
8 changed files with 46 additions and 27 deletions

View File

@ -11,15 +11,15 @@ import (
type FileSelectorDialog struct {
MustExist bool // Whether the dialog should have a user select an existing file.
FilesChosenCallback func([]string) // Returns slice of filenames selected. nil if user canceled.
CancelCallback func() // Called when the dialog has been canceled by the user
CancelCallback func() // Called when the dialog has been canceled by the user
container *WindowContainer
x, y int
width, height int
focused bool
tabOrder []Component
tabOrderIdx int
tabOrder []Component
tabOrderIdx int
inputField *InputField
confirmButton *Button
@ -87,7 +87,7 @@ func (d *FileSelectorDialog) GetPos() (int, int) {
func (d *FileSelectorDialog) SetPos(x, y int) {
d.x, d.y = x, y
d.container.SetPos(x, y)
d.inputField.SetPos(d.x+1, d.y+2) // Center input field
d.inputField.SetPos(d.x+1, d.y+2) // Center input field
d.cancelButton.SetPos(d.x+1, d.y+4) // Place "Cancel" button on left, bottom
}