aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/confview.go
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2019-06-03 17:32:21 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-07 11:31:53 +0200
commitdf825b003edfd61b69679a8017cf7d4c942f9ab4 (patch)
treeb0fba7c72f84581a8105387929cd1d7db122b189 /ui/confview.go
parentservices: iterate through groups using helper (diff)
downloadwireguard-windows-df825b003edfd61b69679a8017cf7d4c942f9ab4.tar.xz
wireguard-windows-df825b003edfd61b69679a8017cf7d4c942f9ab4.zip
ui: remove hacks from confview
Signed-off-by: Alexander Neumann <alexander.neumann@picos-software.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/confview.go')
-rw-r--r--ui/confview.go28
1 files changed, 3 insertions, 25 deletions
diff --git a/ui/confview.go b/ui/confview.go
index a44da527..b84852b3 100644
--- a/ui/confview.go
+++ b/ui/confview.go
@@ -138,16 +138,12 @@ func (lt *labelTextLine) show(text string) {
lt.label.SetVisible(true)
lt.text.SetVisible(true)
lt.text.SetTextSelection(s, e)
-
- lt.label.Parent().SendMessage(win.WM_SIZING, 0, 0) //TODO: This here is a filthy hack that shouldn't be required!
}
func (lt *labelTextLine) hide() {
lt.text.SetText("")
lt.label.SetVisible(false)
lt.text.SetVisible(false)
-
- lt.label.Parent().SendMessage(win.WM_SIZING, 0, 0) //TODO: This here is a filthy hack that shouldn't be required!
}
func newLabelTextLine(fieldName string, parent walk.Container) *labelTextLine {
@@ -506,27 +502,12 @@ func (cv *ConfView) setTunnel(tunnel *manager.Tunnel, config *conf.Config, state
if !(cv.tunnel == nil || tunnel == nil || tunnel.Name == cv.tunnel.Name) {
return
}
+ cv.SetSuspended(true)
+ defer cv.SetSuspended(false)
cv.name.SetVisible(tunnel != nil)
- hasSuspended := false
- suspend := func() {
- return //TODO: this line shouldn't be here! But walk's layout system is totally borked and suspending causes problems.
- if !hasSuspended {
- cv.SetSuspended(true)
- hasSuspended = true
- }
- }
- defer func() {
- if hasSuspended {
- cv.SetSuspended(false)
- }
- }()
- title := "Interface: "
- if cv.name.Title() == title {
- suspend()
- }
- title += config.Name
+ title := "Interface: " + config.Name
if cv.name.Title() != title {
cv.name.SetTitle(title)
}
@@ -562,7 +543,6 @@ func (cv *ConfView) setTunnel(tunnel *manager.Tunnel, config *conf.Config, state
pv.apply(&peer)
inverse[pv] = false
} else {
- suspend()
group, _ := newPaddedGroupGrid(cv)
group.SetTitle("Peer")
pv := newPeerView(group)
@@ -578,12 +558,10 @@ func (cv *ConfView) setTunnel(tunnel *manager.Tunnel, config *conf.Config, state
if e != nil {
continue
}
- suspend()
delete(cv.peers, *k)
groupBox := pv.publicKey.label.Parent().AsContainerBase().Parent().(*walk.GroupBox)
groupBox.SetVisible(false)
groupBox.Parent().Children().Remove(groupBox)
groupBox.Dispose()
}
- cv.SendMessage(win.WM_SIZING, 0, 0) //TODO: This here is a filthy hack that shouldn't be required!
}