summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2020-09-10 10:09:00 +0200
committerAlexander Neumann <alexander.neumann@picos-software.com>2020-09-10 10:09:00 +0200
commit0030d12471d3e9a6ed7931786ca84dc4728ef22f (patch)
treefef033e0a309fcced5e306c8f445e417b1543b41
parentMissed that one in a previous commit (diff)
downloadwireguard-windows-0030d12471d3e9a6ed7931786ca84dc4728ef22f.tar.xz
wireguard-windows-0030d12471d3e9a6ed7931786ca84dc4728ef22f.zip
TableView: Use default font to style a cell if none is provided
-rw-r--r--tableview.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/tableview.go b/tableview.go
index 25928b8b..91166edc 100644
--- a/tableview.go
+++ b/tableview.go
@@ -2211,9 +2211,11 @@ func (tv *TableView) lvWndProc(origWndProcPtr uintptr, hwnd win.HWND, msg uint32
nmlvcd.ClrTextBk = win.COLORREF(tv.style.BackgroundColor)
nmlvcd.ClrText = win.COLORREF(tv.style.TextColor)
- if font := tv.style.Font; font != nil {
- win.SelectObject(nmlvcd.Nmcd.Hdc, win.HGDIOBJ(font.handleForDPI(dpi)))
+ font := tv.style.Font
+ if font == nil {
+ font = tv.Font()
}
+ win.SelectObject(nmlvcd.Nmcd.Hdc, win.HGDIOBJ(font.handleForDPI(dpi)))
}
return 0