()
| 6613 | } |
| 6614 | |
| 6615 | func layoutPM() fyne.CanvasObject { |
| 6616 | session.Domain = "app.messages.contact" |
| 6617 | |
| 6618 | if !walletapi.Connected { |
| 6619 | session.Window.SetContent(layoutSettings()) |
| 6620 | } |
| 6621 | |
| 6622 | getPrimaryUsername() |
| 6623 | |
| 6624 | contactAddress := "" |
| 6625 | |
| 6626 | // So message contact sizes are not overblown from UI |
| 6627 | _, err := globals.ParseValidateAddress(messages.Contact) |
| 6628 | if err != nil { |
| 6629 | //_, err := engram.Disk.NameToAddress(messages.Contact) |
| 6630 | _, err := checkUsername(messages.Contact, -1) |
| 6631 | if err == nil { |
| 6632 | contactAddress = messages.Contact |
| 6633 | } |
| 6634 | } /* else { |
| 6635 | short := messages.Contact[len(messages.Contact)-10:] |
| 6636 | contactAddress = "..." + short |
| 6637 | }*/ |
| 6638 | |
| 6639 | // Safety, even though valid addresses are sized enough but usernames may not be |
| 6640 | if len(messages.Contact) > DEFAULT_USERADDR_SHORTEN_LENGTH+3 { |
| 6641 | short := messages.Contact[len(messages.Contact)-DEFAULT_USERADDR_SHORTEN_LENGTH:] |
| 6642 | contactAddress = "..." + short |
| 6643 | } |
| 6644 | |
| 6645 | title := canvas.NewText("M E S S A G E S", colors.Gray) |
| 6646 | title.TextStyle = fyne.TextStyle{Bold: true} |
| 6647 | title.TextSize = 16 |
| 6648 | |
| 6649 | heading := canvas.NewText(contactAddress, colors.Green) |
| 6650 | heading.TextSize = 22 |
| 6651 | heading.Alignment = fyne.TextAlignCenter |
| 6652 | heading.TextStyle = fyne.TextStyle{Bold: true} |
| 6653 | |
| 6654 | lastActive := canvas.NewText("", colors.Gray) |
| 6655 | lastActive.TextSize = 12 |
| 6656 | lastActive.Alignment = fyne.TextAlignCenter |
| 6657 | lastActive.TextStyle = fyne.TextStyle{Bold: false} |
| 6658 | |
| 6659 | menuLabel := canvas.NewText(" M O R E O P T I O N S ", colors.Gray) |
| 6660 | menuLabel.TextSize = 11 |
| 6661 | menuLabel.Alignment = fyne.TextAlignCenter |
| 6662 | menuLabel.TextStyle = fyne.TextStyle{Bold: true} |
| 6663 | |
| 6664 | sep := canvas.NewRectangle(colors.Gray) |
| 6665 | sep.SetMinSize(fyne.NewSize(ui.Width*0.2, 2)) |
| 6666 | |
| 6667 | line1 := container.NewVBox( |
| 6668 | layout.NewSpacer(), |
| 6669 | sep, |
| 6670 | layout.NewSpacer(), |
| 6671 | ) |
| 6672 |
no test coverage detected