forked from Elara6331/itd
Add comments to gui
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user