-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathhandle_help.go
40 lines (30 loc) · 1.06 KB
/
handle_help.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
_ "embed"
"fmt"
"time"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/widget"
)
//go:embed ABOUT.md
var readmeFile string
func (ed *EditorWindow) handleHelp() {
label1 := widget.NewLabel(fmt.Sprintf("(C) %d Ivan Voras <[email protected]>", time.Now().Year()))
label1.Wrapping = fyne.TextWrapWord
label2 := widget.NewRichTextFromMarkdown("Source: [https://github.com/ivoras/EncryptedNotepad2](https://github.com/ivoras/EncryptedNotepad2)")
//label2 := widget.NewLabel("Original source repo: https://github.com/ivoras/EncryptedNotepad2")
label2.Wrapping = fyne.TextWrapWord
infoLines := container.NewVBox(
label1,
label2,
)
readmeEdit := widget.NewRichTextFromMarkdown(readmeFile)
readmeEdit.Wrapping = fyne.TextWrapWord
readmeEdit.Scroll = container.ScrollVerticalOnly
mainLayout := container.NewBorder(infoLines, nil, nil, nil, readmeEdit)
dlg := dialog.NewCustom(fmt.Sprintf("About %s v%s", APP_NAME, APP_VERSION), "Ok", mainLayout, ed.win)
dlg.Resize(fyne.NewSize(640, 480))
dlg.Show()
}