Skip to content

Commit

Permalink
Improve ui styling a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Jan 4, 2025
1 parent 42762c3 commit 06c6d4f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions internal/ui/recv.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ func createRecvPage(_ fyne.App, _ fyne.Window) fyne.CanvasObject {
icon.FillMode = canvas.ImageFillContain
icon.SetMinSize(fyne.NewSquareSize(200))

title := &widget.Label{Text: "Receive Data", Alignment: fyne.TextAlignCenter, TextStyle: fyne.TextStyle{Bold: true}}
description := &widget.Label{Text: "Enter a code below to start receiving data", Alignment: fyne.TextAlignCenter}
description := &widget.Label{Text: "Enter a code below to start receiving data.", Alignment: fyne.TextAlignCenter}

code := &widget.Entry{PlaceHolder: "Code from sender", Validator: util.CodeValidator}
start := &widget.Button{Text: "Start Receive", Icon: theme.DownloadIcon(), Importance: widget.HighImportance}

content := container.NewVBox(icon, &widget.Separator{}, title, description, &widget.Separator{}, code)
content := container.NewVBox(icon, description, &widget.Separator{}, code, &widget.Separator{}, container.NewCenter(start))

return container.NewCenter(content)
}
16 changes: 7 additions & 9 deletions internal/ui/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ func createSendPage(_ fyne.App, _ fyne.Window) fyne.CanvasObject {
icon.FillMode = canvas.ImageFillContain
icon.SetMinSize(fyne.NewSquareSize(200))

title := &widget.Label{Text: "Send Data", Alignment: fyne.TextAlignCenter, TextStyle: fyne.TextStyle{Bold: true}}
description := &widget.Label{Text: "Select data type below or drop files here", Alignment: fyne.TextAlignCenter}
description := &widget.Label{Text: "Select data type below or drop files here.", Alignment: fyne.TextAlignCenter}

// Buttons for starting sends.
file := &widget.Button{Icon: theme.FileTextIcon(), Text: "Send File"}
folder := &widget.Button{Icon: theme.FolderIcon(), Text: "Send Folder"}
text := &widget.Button{Icon: theme.DocumentIcon(), Text: "Send Text"}
file := &widget.Button{Icon: theme.FileTextIcon(), Text: "Send File", Importance: widget.HighImportance}
folder := &widget.Button{Icon: theme.FolderIcon(), Text: "Send Folder", Importance: widget.HighImportance}
text := &widget.Button{Icon: theme.DocumentIcon(), Text: "Send Text", Importance: widget.HighImportance}

buttons := container.NewVBox(icon, &widget.Separator{}, title, description, &widget.Separator{}, file, folder, text)

return container.NewCenter(buttons)
buttons := container.NewCenter(container.NewHBox(file, &widget.Separator{}, folder, &widget.Separator{}, text))
content := container.NewVBox(icon, description, &widget.Separator{}, buttons)
return container.NewCenter(content)
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
w := a.NewWindow("Rymdport")

w.SetContent(ui.Create(a, w))
w.Resize(fyne.NewSize(700, 400))
w.Resize(fyne.NewSize(600, 400))
w.SetMaster()
w.ShowAndRun()
}

0 comments on commit 06c6d4f

Please sign in to comment.