diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2020-09-03 16:17:02 +0200 |
---|---|---|
committer | Alexander Neumann <alexander.neumann@picos-software.com> | 2020-09-03 16:17:02 +0200 |
commit | 5d9132a89763dee9c0664a599da7a8a733a7dd31 (patch) | |
tree | 013924828ef9b51b81843932b9e8fbd76662b0b9 | |
parent | NotifyIcon: Don't destroy the associated window (diff) | |
download | wireguard-windows-5d9132a89763dee9c0664a599da7a8a733a7dd31.tar.xz wireguard-windows-5d9132a89763dee9c0664a599da7a8a733a7dd31.zip |
ListBox/ListItemStyle: Allow override of TextColor
-rw-r--r-- | listbox.go | 1 | ||||
-rw-r--r-- | models.go | 3 |
2 files changed, 3 insertions, 1 deletions
@@ -704,6 +704,7 @@ func (lb *ListBox) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) ui } else { lb.style.LineColor = RGB(255, 255, 255) } + lb.style.defaultTextColor = lb.style.TextColor lb.style.DrawBackground() @@ -394,6 +394,7 @@ type ListItemStyler interface { type ListItemStyle struct { BackgroundColor Color TextColor Color + defaultTextColor Color LineColor Color Font *Font index int @@ -476,7 +477,7 @@ func (lis *ListItemStyle) DrawBackground() error { // DrawText draws text inside given bounds specified in native pixels. func (lis *ListItemStyle) DrawText(text string, bounds Rectangle, format DrawTextFormat) error { - if lis.hTheme != 0 { + if lis.hTheme != 0 && lis.TextColor == lis.defaultTextColor { if lis.Font != nil { hFontOld := win.SelectObject(lis.hdc, win.HGDIOBJ(lis.Font.handleForDPI(lis.dpi))) defer win.SelectObject(lis.hdc, hFontOld) |