aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/manage_tunnels.go
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2019-04-01 14:24:27 +0200
committerAlexander Neumann <alexander.neumann@picos-software.com>2019-04-23 11:04:59 +0200
commiteee09ee4c25346987fd3090ed2339ec1a7a08f70 (patch)
tree5165b567d87ade3c529a297182327639d7874aba /ui/manage_tunnels.go
parentui: fix splitter layout not displaying widgets (diff)
downloadwireguard-windows-eee09ee4c25346987fd3090ed2339ec1a7a08f70.tar.xz
wireguard-windows-eee09ee4c25346987fd3090ed2339ec1a7a08f70.zip
ui: work around a bug in walk to have our own tool bar below the tunnels list
Signed-off-by: Alexander Neumann <alexander.neumann@picos-software.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--ui/manage_tunnels.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/ui/manage_tunnels.go b/ui/manage_tunnels.go
index c7673776..14c5afe9 100644
--- a/ui/manage_tunnels.go
+++ b/ui/manage_tunnels.go
@@ -61,11 +61,18 @@ func (mtw *ManageTunnelsWindow) setup() error {
tunnelsContainer, _ := walk.NewComposite(splitter)
tunnelsContainer.SetLayout(walk.NewVBoxLayout())
+ mtw.tunnelsView, _ = NewTunnelsView(tunnelsContainer)
+ mtw.tunnelsView.ItemActivated().Attach(mtw.onEditTunnel)
+ mtw.tunnelsView.CurrentIndexChanged().Attach(mtw.updateConfView)
+
// ToolBar actions
{
- // TODO: Currently hijacking the window ToolBar,
- // Adding the toolbar to the bottom of the control may be better
- tunnelsToolBar := mtw.ToolBar()
+ // HACK: Because of https://github.com/lxn/walk/issues/481
+ // we need to put the ToolBar into its own Composite.
+ toolBarContainer, _ := walk.NewComposite(tunnelsContainer)
+ toolBarContainer.SetLayout(walk.NewHBoxLayout())
+
+ tunnelsToolBar, _ := walk.NewToolBar(toolBarContainer)
importAction := walk.NewAction()
importAction.SetText("Import tunnels from file...")
@@ -102,10 +109,6 @@ func (mtw *ManageTunnelsWindow) setup() error {
settingsMenuAction.SetText("Export")
}
- mtw.tunnelsView, _ = NewTunnelsView(tunnelsContainer)
- mtw.tunnelsView.ItemActivated().Attach(mtw.onEditTunnel)
- mtw.tunnelsView.CurrentIndexChanged().Attach(mtw.updateConfView)
-
currentTunnelContainer, _ := walk.NewComposite(splitter)
currentTunnelContainer.SetLayout(walk.NewVBoxLayout())