Add comments to gui

This commit is contained in:
2021-08-26 08:47:17 -07:00
parent b7bd385c43
commit 0721b7f9d4
6 changed files with 74 additions and 5 deletions

View File

@@ -12,18 +12,23 @@ import (
)
func notifyTab(parent fyne.Window) *fyne.Container {
// Create new entry for notification title
titleEntry := widget.NewEntry()
titleEntry.SetPlaceHolder("Title")
// Create multiline entry for notification body
bodyEntry := widget.NewMultiLineEntry()
bodyEntry.SetPlaceHolder("Body")
// Create new button to send notification
sendBtn := widget.NewButton("Send", func() {
// Dial itd UNIX socket
conn, err := net.Dial("unix", SockPath)
if err != nil {
guiErr(err, "Error dialing socket", parent)
return
}
// Encode notify request on connection
json.NewEncoder(conn).Encode(types.Request{
Type: types.ReqTypeNotify,
Data: types.ReqDataNotify{
@@ -33,6 +38,7 @@ func notifyTab(parent fyne.Window) *fyne.Container {
})
})
// Return new container containing all elements
return container.NewVBox(
layout.NewSpacer(),
titleEntry,