diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-10-31 12:37:07 +0100 |
---|---|---|
committer | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-10-31 12:37:07 +0100 |
commit | f2f0acf7ad550f40029bf29aa5322337ebce631b (patch) | |
tree | 31444d8547faf303dc4de343a616d605f23ee9b5 | |
parent | Merge pull request #643 from zx2c4-forks/jd/tableviewdpichange (diff) | |
download | wireguard-windows-f2f0acf7ad550f40029bf29aa5322337ebce631b.tar.xz wireguard-windows-f2f0acf7ad550f40029bf29aa5322337ebce631b.zip |
TableView: Fix StretchLastColumn DPI change glitch
-rw-r--r-- | tableview.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tableview.go b/tableview.go index 43576260..764589ae 100644 --- a/tableview.go +++ b/tableview.go @@ -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 @@ -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 |