summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--listbox.go1
-rw-r--r--models.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/listbox.go b/listbox.go
index 52f01b8e..b777ebbd 100644
--- a/listbox.go
+++ b/listbox.go
@@ -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()
diff --git a/models.go b/models.go
index 7bb397b1..7a2d6c0d 100644
--- a/models.go
+++ b/models.go
@@ -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)