summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-10-31 11:23:41 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-10-31 11:24:46 +0100
commit110941da53205c8780c6326a7238784a322b9b16 (patch)
tree9952cdf2ec875d876f7868c683bd4b1c2044c1f7
parentIcon: Switch to LoadIconWithScaleDown() (diff)
downloadwireguard-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.go10
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()
+ }
}
}