From 227ebc5ad0298786ad244c82d6a44a70c79b47ab Mon Sep 17 00:00:00 2001 From: genshen Date: Fri, 1 May 2020 23:41:03 +0800 Subject: [PATCH] fix(gui): create Entry and password Entry from struct, thus there is option to show password as plain text --- client-ui/main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client-ui/main.go b/client-ui/main.go index 0e05e71..bec565a 100644 --- a/client-ui/main.go +++ b/client-ui/main.go @@ -45,8 +45,8 @@ func main() { //w.Resize(fyne.NewSize(100, 100)) // basic input - uiLocalAddr := newEntryWithText("127.0.0.1:1080") - uiRemoteAddr := newEntryWithText("ws://proxy.gensh.me") + uiLocalAddr := &widget.Entry{Text: "127.0.0.1:1080"} + uiRemoteAddr := &widget.Entry{Text: "ws://proxy.gensh.me"} uiHttpEnable := newCheckbox("", false, nil) uiHttpLocalAddr := newEntryWithText("127.0.0.1:1086") @@ -64,10 +64,9 @@ func main() { uiVpnEnable := newCheckbox("enable ustb vpn", true, nil) uiVpnForceLogout := newCheckbox("", true, nil) uiVpnHostEncrypt := newCheckbox("", true, nil) - uiVpnHostInput := newEntryWithText("n.ustb.edu.cn") - uiVpnUsername := newEntryWithText("") - uiVpnPassword := newEntryWithText("") - uiVpnPassword.Password = true + uiVpnHostInput := &widget.Entry{Text: "n.ustb.edu.cn"} + uiVpnUsername := &widget.Entry{Text: ""} + uiVpnPassword := &widget.Entry{Text: "", Password: true} loadVPNPreference(wssApp.Preferences(), uiVpnEnable, uiVpnForceLogout, uiVpnHostEncrypt, uiVpnHostInput, uiVpnUsername, uiVpnPassword)