diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-04-29 15:04:33 +0200 |
---|---|---|
committer | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-04-29 15:04:33 +0200 |
commit | 65b23005e12295ad59ad7b59e31b77ba07e32235 (patch) | |
tree | 16c6fb4f25af37395ddcdcf1f25e04df65822e2f /groupbox.go | |
parent | GroupBox: Fix overdrawing of contained composite with double buffering (diff) | |
download | wireguard-windows-65b23005e12295ad59ad7b59e31b77ba07e32235.tar.xz wireguard-windows-65b23005e12295ad59ad7b59e31b77ba07e32235.zip |
GroupBox: Use left margin from layout for check box offset
Diffstat (limited to 'groupbox.go')
-rw-r--r-- | groupbox.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/groupbox.go b/groupbox.go index 576a85fa..3e37c5f6 100644 --- a/groupbox.go +++ b/groupbox.go @@ -368,7 +368,13 @@ func (gb *GroupBox) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) u if gb.Checkable() { s := gb.checkBox.SizeHint() - gb.checkBox.SetBounds(Rectangle{gb.headerHeight * 2 / 3, gb.headerHeight, s.Width, s.Height}) + var x int + if l := gb.Layout(); l != nil { + x = l.Margins().HNear + } else { + x = gb.headerHeight * 2 / 3 + } + gb.checkBox.SetBounds(Rectangle{x, gb.headerHeight, s.Width, s.Height}) } gbcb := gb.ClientBounds() |