mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
improved
This commit is contained in:
parent
918fc21594
commit
f89aea6470
1 changed files with 42 additions and 3 deletions
|
@ -98,6 +98,7 @@ func main() {
|
||||||
sendFileButton.SetText(fnames[len(fnames)-1])
|
sendFileButton.SetText(fnames[len(fnames)-1])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
sendScreen := widget.NewVBox(
|
sendScreen := widget.NewVBox(
|
||||||
widget.NewLabelWithStyle("Send a file", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Send a file", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
sendFileButton,
|
sendFileButton,
|
||||||
|
@ -105,9 +106,45 @@ func main() {
|
||||||
fmt.Println("send")
|
fmt.Println("send")
|
||||||
}),
|
}),
|
||||||
layout.NewSpacer(),
|
layout.NewSpacer(),
|
||||||
progress,
|
widget.NewHBox(
|
||||||
|
widget.NewLabel("Code phrase: something"),
|
||||||
|
),
|
||||||
|
widget.NewHBox(
|
||||||
|
widget.NewLabel("Progress:"),
|
||||||
|
progress,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
progress.Hide()
|
|
||||||
|
var codePhraseToReceive string
|
||||||
|
entry := widget.NewEntry()
|
||||||
|
entry.OnChanged = func(text string) {
|
||||||
|
fmt.Println("Entered", text)
|
||||||
|
codePhraseToReceive = text
|
||||||
|
}
|
||||||
|
entry.SetPlaceHolder("Enter code phrase")
|
||||||
|
var receiveFileButtion *widget.Button
|
||||||
|
receiveFileButtion = widget.NewButton("Set directory to save", func() {
|
||||||
|
filename, err := nativedialog.Directory().Title("Now find a dir").Browse()
|
||||||
|
fmt.Println(filename)
|
||||||
|
fmt.Println(err)
|
||||||
|
receiveFileButtion.SetText(filename)
|
||||||
|
})
|
||||||
|
receiveScreen := widget.NewVBox(
|
||||||
|
widget.NewLabelWithStyle("Receive a file", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
|
receiveFileButtion,
|
||||||
|
entry,
|
||||||
|
widget.NewButton("Receive", func() {
|
||||||
|
fmt.Println("codePhraseToReceive")
|
||||||
|
}),
|
||||||
|
layout.NewSpacer(),
|
||||||
|
widget.NewHBox(
|
||||||
|
widget.NewLabel("Progress:"),
|
||||||
|
progress,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
progress.SetValue(0)
|
||||||
|
|
||||||
top := makeCell()
|
top := makeCell()
|
||||||
bottom := makeCell()
|
bottom := makeCell()
|
||||||
left := makeCell()
|
left := makeCell()
|
||||||
|
@ -116,6 +153,8 @@ func main() {
|
||||||
borderLayout := layout.NewBorderLayout(top, bottom, left, right)
|
borderLayout := layout.NewBorderLayout(top, bottom, left, right)
|
||||||
sendScreenWrap := fyne.NewContainerWithLayout(borderLayout,
|
sendScreenWrap := fyne.NewContainerWithLayout(borderLayout,
|
||||||
top, bottom, left, right, sendScreen)
|
top, bottom, left, right, sendScreen)
|
||||||
|
receiveScreenWrap := fyne.NewContainerWithLayout(borderLayout,
|
||||||
|
top, bottom, left, right, receiveScreen)
|
||||||
|
|
||||||
box1 := widget.NewVBox(
|
box1 := widget.NewVBox(
|
||||||
widget.NewLabel("Hello Fyne!"),
|
widget.NewLabel("Hello Fyne!"),
|
||||||
|
@ -131,7 +170,6 @@ func main() {
|
||||||
filename, err := nativedialog.Directory().Title("Now find a dir").Browse()
|
filename, err := nativedialog.Directory().Title("Now find a dir").Browse()
|
||||||
fmt.Println(filename)
|
fmt.Println(filename)
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
widget.NewButton("Receive", func() {
|
widget.NewButton("Receive", func() {
|
||||||
|
@ -179,6 +217,7 @@ func main() {
|
||||||
tabs := widget.NewTabContainer(
|
tabs := widget.NewTabContainer(
|
||||||
widget.NewTabItemWithIcon("Welcome", theme.HomeIcon(), welcomeScreen(a)),
|
widget.NewTabItemWithIcon("Welcome", theme.HomeIcon(), welcomeScreen(a)),
|
||||||
widget.NewTabItemWithIcon("Send", theme.MailSendIcon(), sendScreenWrap),
|
widget.NewTabItemWithIcon("Send", theme.MailSendIcon(), sendScreenWrap),
|
||||||
|
widget.NewTabItemWithIcon("Receive", theme.MailSendIcon(), receiveScreenWrap),
|
||||||
)
|
)
|
||||||
tabs.SetTabLocation(widget.TabLocationLeading)
|
tabs.SetTabLocation(widget.TabLocationLeading)
|
||||||
w.SetContent(tabs)
|
w.SetContent(tabs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue