-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathabout.go
More file actions
57 lines (51 loc) · 1.19 KB
/
about.go
File metadata and controls
57 lines (51 loc) · 1.19 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main
import (
"os/exec"
"github.com/astaxie/beego/logs"
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
)
func OpenBrowserWeb(url string) {
cmd := exec.Command("rundll32", "url.dll,FileProtocolHandler", url)
err := cmd.Run()
if err != nil {
logs.Error("run cmd fail, %s", err.Error())
}
}
func AboutAction() {
var ok *walk.PushButton
var about *walk.Dialog
var err error
_, err = Dialog{
AssignTo: &about,
Title: "Sponsor",
Icon: walk.IconInformation(),
MinSize: Size{Width: 200, Height: 200},
DefaultButton: &ok,
Layout: VBox{},
Children: []Widget{
Composite{
Layout: HBox{},
Children: []Widget{
TextLabel{
MinSize: Size{Width: 180, Height: 180},
Text: "Thank you for using my software. If you are pleased with it, you can donate through the link below. Thank you very much for your support.",
},
},
},
PushButton{
Text: "paypal.me",
OnClicked: func() {
OpenBrowserWeb("https://paypal.me/lixiangyun")
},
},
PushButton{
Text: "OK",
OnClicked: func() { about.Cancel() },
},
},
}.Run(mainWindow)
if err != nil {
logs.Error(err.Error())
}
}