diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2015-08-11 10:28:30 +0200 |
---|---|---|
committer | Alexander Neumann <alexander.neumann@picos-software.com> | 2015-08-11 10:28:30 +0200 |
commit | bc25231c9951bf136b5c0f0c1ee64a4066ea4994 (patch) | |
tree | 6f8c89040aff3c84009d0b9a009b33ff7e0a4db2 /groupbox.go | |
parent | Propagate font to widget when adding it to a container (diff) | |
download | wireguard-windows-bc25231c9951bf136b5c0f0c1ee64a4066ea4994.tar.xz wireguard-windows-bc25231c9951bf136b5c0f0c1ee64a4066ea4994.zip |
GroupBox: Fix font application
Diffstat (limited to 'groupbox.go')
-rw-r--r-- | groupbox.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/groupbox.go b/groupbox.go index 821eef88..3a7e7d32 100644 --- a/groupbox.go +++ b/groupbox.go @@ -58,9 +58,7 @@ func NewGroupBox(parent Container) (*GroupBox, error) { return nil, lastError("CreateWindowEx(BUTTON)") } - // Set font to nil first to outsmart SetFont. - // gb.font = nil - // gb.SetFont(defaultFont) + setWindowFont(gb.hWndGroupBox, gb.Font()) gb.MustRegisterProperty("Title", NewProperty( func() interface{} { @@ -114,9 +112,15 @@ func (gb *GroupBox) ClientBounds() Rectangle { } func (gb *GroupBox) applyFont(font *Font) { - setWindowFont(gb.hWndGroupBox, font) + gb.WidgetBase.applyFont(font) - gb.composite.applyFont(font) + if gb.hWndGroupBox != 0 { + setWindowFont(gb.hWndGroupBox, font) + } + + if gb.composite != nil { + gb.composite.applyFont(font) + } } func (gb *GroupBox) SetSuspended(suspend bool) { |