Skip to content

Commit

Permalink
TableView: Fix StretchLastColumn DPI change glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
lxn committed Oct 31, 2019
1 parent 832efdc commit f2f0acf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tableview.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ type TableView struct {
formActivatingHandle int
customHeaderHeight int // in native pixels?
customRowHeight int // in native pixels?
dpiOfPrevStretchLastColumn int
scrolling bool
inSetCurrentIndex bool
inMouseEvent bool
Expand Down Expand Up @@ -1447,6 +1448,12 @@ func (tv *TableView) StretchLastColumn() error {
if 0 == win.SendMessage(hwnd, win.LVM_SETCOLUMNWIDTH, uintptr(colCount-1), lp) {
return newError("LVM_SETCOLUMNWIDTH failed")
}

if dpi := tv.DPI(); dpi != tv.dpiOfPrevStretchLastColumn {
tv.dpiOfPrevStretchLastColumn = dpi

tv.Invalidate()
}
}

return nil
Expand Down

0 comments on commit f2f0acf

Please sign in to comment.