diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-10-31 11:26:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-31 11:26:01 +0100 |
commit | 832efdc040000fcdbfe5314b217a4a1daa34801d (patch) | |
tree | 9952cdf2ec875d876f7868c683bd4b1c2044c1f7 | |
parent | Icon: Switch to LoadIconWithScaleDown() (diff) | |
parent | tableview: only recreate image list if one exists (diff) | |
download | wireguard-windows-832efdc040000fcdbfe5314b217a4a1daa34801d.tar.xz wireguard-windows-832efdc040000fcdbfe5314b217a4a1daa34801d.zip |
Merge pull request #643 from zx2c4-forks/jd/tableviewdpichange
tableview: only recreate image list if one exists
-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() + } } } |