aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ui/confview.go6
-rw-r--r--ui/iconprovider.go2
-rw-r--r--ui/logpage.go3
-rw-r--r--ui/managewindow.go4
-rw-r--r--ui/tunneleditdialog.go4
-rw-r--r--ui/tunnelspage.go12
-rw-r--r--ui/updatepage.go1
7 files changed, 20 insertions, 12 deletions
diff --git a/ui/confview.go b/ui/confview.go
index 7387d2b3..375f0e8f 100644
--- a/ui/confview.go
+++ b/ui/confview.go
@@ -376,7 +376,7 @@ func newPaddedGroupGrid(parent walk.Container) (group *walk.GroupBox, err error)
}
}()
layout := walk.NewGridLayout()
- layout.SetMargins(walk.Margins{10, 15, 10, 5})
+ layout.SetMargins(walk.Margins{10, 5, 10, 5})
err = group.SetLayout(layout)
if err != nil {
return nil, err
@@ -392,7 +392,9 @@ func newPaddedGroupGrid(parent walk.Container) (group *walk.GroupBox, err error)
func NewConfView(parent walk.Container) (*ConfView, error) {
cv := new(ConfView)
cv.ScrollView, _ = walk.NewScrollView(parent)
- cv.SetLayout(walk.NewVBoxLayout())
+ vlayout := walk.NewVBoxLayout()
+ vlayout.SetMargins(walk.Margins{5, 0, 5, 0})
+ cv.SetLayout(vlayout)
cv.name, _ = newPaddedGroupGrid(cv)
cv.interfaze = newInterfaceView(cv.name)
cv.interfaze.toggleActive.button.Clicked().Attach(cv.onToggleActiveClicked)
diff --git a/ui/iconprovider.go b/ui/iconprovider.go
index 6d7e77bc..f9d3597e 100644
--- a/ui/iconprovider.go
+++ b/ui/iconprovider.go
@@ -241,7 +241,7 @@ func (tsip *IconProvider) drawUpdateAvailableImage(size int) (*walk.Bitmap, erro
defer canvas.Dispose()
// This should be scaled for DPI but instead we do the opposite, due to a walk bug.
- margin := int(3.0 - (tsip.scale - 1.0) * 3.0)
+ margin := int(3.0 - (tsip.scale-1.0)*3.0)
if margin < 0 {
margin = 0
}
diff --git a/ui/logpage.go b/ui/logpage.go
index d99ce5ff..c0d4cd2a 100644
--- a/ui/logpage.go
+++ b/ui/logpage.go
@@ -40,7 +40,6 @@ func NewLogPage() (*LogPage, error) {
lp.SetTitle("Log")
lp.SetLayout(walk.NewVBoxLayout())
- lp.Layout().SetMargins(walk.Margins{18, 18, 18, 18})
if lp.logView, err = walk.NewTableView(lp); err != nil {
return nil, err
@@ -69,7 +68,7 @@ func NewLogPage() (*LogPage, error) {
return nil, err
}
buttonsContainer.SetLayout(walk.NewHBoxLayout())
- buttonsContainer.Layout().SetMargins(walk.Margins{0, 12, 0, 0})
+ buttonsContainer.Layout().SetMargins(walk.Margins{})
walk.NewHSpacer(buttonsContainer)
diff --git a/ui/managewindow.go b/ui/managewindow.go
index dc062117..01e7f734 100644
--- a/ui/managewindow.go
+++ b/ui/managewindow.go
@@ -50,7 +50,9 @@ func NewManageTunnelsWindow() (*ManageTunnelsWindow, error) {
mtw.AddDisposable(font)
mtw.SetFont(font)
mtw.SetSize(walk.Size{900, 600})
- mtw.SetLayout(walk.NewVBoxLayout())
+ vlayout := walk.NewVBoxLayout()
+ vlayout.SetMargins(walk.Margins{5, 5, 5, 5})
+ mtw.SetLayout(vlayout)
mtw.Closing().Attach(func(canceled *bool, reason walk.CloseReason) {
// "Close to tray" instead of exiting application
*canceled = true
diff --git a/ui/tunneleditdialog.go b/ui/tunneleditdialog.go
index 7efd68d2..6f5ca8ab 100644
--- a/ui/tunneleditdialog.go
+++ b/ui/tunneleditdialog.go
@@ -76,14 +76,14 @@ func runTunnelEditDialog(owner walk.Form, tunnel *service.Tunnel) *conf.Config {
layout := walk.NewGridLayout()
layout.SetSpacing(6)
- layout.SetMargins(walk.Margins{18, 18, 18, 18})
+ layout.SetMargins(walk.Margins{10, 10, 10, 10})
layout.SetColumnStretchFactor(1, 3)
dlg.Dialog, _ = walk.NewDialog(owner)
dlg.SetIcon(owner.Icon())
dlg.SetTitle(title)
dlg.SetLayout(layout)
- dlg.SetMinMaxSize(walk.Size{500, 400}, walk.Size{9999, 9999})
+ dlg.SetMinMaxSize(walk.Size{500, 400}, walk.Size{0, 0})
nameLabel, _ := walk.NewTextLabel(dlg)
layout.SetRange(nameLabel, walk.Rectangle{0, 0, 1, 1})
diff --git a/ui/tunnelspage.go b/ui/tunnelspage.go
index 8650ece6..a305496e 100644
--- a/ui/tunnelspage.go
+++ b/ui/tunnelspage.go
@@ -43,7 +43,9 @@ func NewTunnelsPage() (*TunnelsPage, error) {
tp.SetLayout(walk.NewHBoxLayout())
tunnelsContainer, _ := walk.NewComposite(tp)
- tunnelsContainer.SetLayout(walk.NewVBoxLayout())
+ vlayout := walk.NewVBoxLayout()
+ vlayout.SetMargins(walk.Margins{})
+ tunnelsContainer.SetLayout(vlayout)
//TODO: deal with remaining disposables in case the next line fails
@@ -58,7 +60,9 @@ func NewTunnelsPage() (*TunnelsPage, error) {
// 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())
+ hlayout := walk.NewHBoxLayout()
+ hlayout.SetMargins(walk.Margins{})
+ toolBarContainer.SetLayout(hlayout)
tunnelsToolBar, _ := walk.NewToolBarWithOrientationAndButtonStyle(toolBarContainer, walk.Horizontal, walk.ToolBarButtonTextOnly)
@@ -94,7 +98,9 @@ func NewTunnelsPage() (*TunnelsPage, error) {
}
currentTunnelContainer, _ := walk.NewComposite(tp)
- currentTunnelContainer.SetLayout(walk.NewVBoxLayout())
+ vlayout = walk.NewVBoxLayout()
+ vlayout.SetMargins(walk.Margins{})
+ currentTunnelContainer.SetLayout(vlayout)
tp.Layout().(interface{ SetStretchFactor(walk.Widget, int) error }).SetStretchFactor(currentTunnelContainer, 10)
tp.confView, _ = NewConfView(currentTunnelContainer)
diff --git a/ui/updatepage.go b/ui/updatepage.go
index 0611ba08..9aa056a1 100644
--- a/ui/updatepage.go
+++ b/ui/updatepage.go
@@ -28,7 +28,6 @@ func NewUpdatePage() (*UpdatePage, error) {
up.SetImage(iconProvider.updateAvailableImage)
//TODO: make title bold
up.SetLayout(walk.NewVBoxLayout())
- up.Layout().SetMargins(walk.Margins{18, 18, 18, 18})
instructions, _ := walk.NewTextLabel(up)
instructions.SetText("An update to WireGuard is available. It is highly advisable to update without delay.")