summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2018-12-05 17:16:22 +0100
committerAlexander Neumann <alexander.neumann@picos-software.com>2018-12-05 17:16:22 +0100
commit7a11130599653e551115e6e4bd5f6e1f69649b40 (patch)
treed425dfa662fc38d395ca9891880669dcd23c29d9
parentLabel reform (diff)
downloadwireguard-windows-7a11130599653e551115e6e4bd5f6e1f69649b40.tar.xz
wireguard-windows-7a11130599653e551115e6e4bd5f6e1f69649b40.zip
Fix label drawing when no background is set + add comment about dynamic line wrapping
-rw-r--r--brush.go2
-rw-r--r--declarative/textlabel.go2
-rw-r--r--static.go2
3 files changed, 4 insertions, 2 deletions
diff --git a/brush.go b/brush.go
index b63a6eb0..478b7d2e 100644
--- a/brush.go
+++ b/brush.go
@@ -196,6 +196,8 @@ func (*SystemColorBrush) simple() bool {
return true
}
+var sysColorBtnFaceBrushSingleton, _ = NewSystemColorBrush(SysColorBtnFace)
+
type SolidColorBrush struct {
brushBase
color Color
diff --git a/declarative/textlabel.go b/declarative/textlabel.go
index 0eef43f7..430c85fc 100644
--- a/declarative/textlabel.go
+++ b/declarative/textlabel.go
@@ -32,7 +32,7 @@ type TextLabel struct {
Enabled Property
Font Font
MaxSize Size
- MinSize Size
+ MinSize Size // Set MinSize.Width to a value > 0 to enable dynamic line wrapping.
Name string
OnBoundsChanged walk.EventHandler
OnKeyDown walk.KeyEventHandler
diff --git a/static.go b/static.go
index 92347ff9..1c7f9452 100644
--- a/static.go
+++ b/static.go
@@ -170,7 +170,7 @@ func (s *static) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uint
bg, wnd := s.backgroundEffective()
if bg == nil {
- break
+ bg = sysColorBtnFaceBrushSingleton
}
s.prepareDCForBackground(dis.HDC, s.hWnd, wnd)