diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-10-31 11:23:41 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-10-31 11:24:46 +0100 |
commit | 110941da53205c8780c6326a7238784a322b9b16 (patch) | |
tree | 9952cdf2ec875d876f7868c683bd4b1c2044c1f7 | |
parent | Icon: Switch to LoadIconWithScaleDown() (diff) | |
download | wireguard-windows-110941da53205c8780c6326a7238784a322b9b16.tar.xz wireguard-windows-110941da53205c8780c6326a7238784a322b9b16.zip |
tableview: only recreate image list if one exists
Otherwise a gap appears around under dpi changes.
-rw-r--r-- | tableview.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tableview.go b/tableview.go index e37574b4..43576260 100644 --- a/tableview.go +++ b/tableview.go @@ -393,11 +393,13 @@ func (tv *TableView) ApplyDPI(dpi int) { column.update() } - tv.disposeImageListAndCaches() + if tv.hIml != 0 { + tv.disposeImageListAndCaches() - if bmp, err := NewBitmapForDPI(SizeFrom96DPI(Size{16, 16}, dpi), dpi); err == nil { - tv.applyImageListForImage(bmp) - bmp.Dispose() + if bmp, err := NewBitmapForDPI(SizeFrom96DPI(Size{16, 16}, dpi), dpi); err == nil { + tv.applyImageListForImage(bmp) + bmp.Dispose() + } } } |