aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit573b583b891f4eb166d2ff333dc1acc0cb4d18a4 (patch)
tree5165b567d87ade3c529a297182327639d7874aba
parentui: fix splitter layout not displaying widgets (diff)
downloadwireguard-windows-573b583b891f4eb166d2ff333dc1acc0cb4d18a4.tar.xz
wireguard-windows-573b583b891f4eb166d2ff333dc1acc0cb4d18a4.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>
-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())