Skip to content

Commit 4a95cb2

Browse files
committed
[Win32] Update images of tree columns upon DPI change
When moving a shell with a tree that uses images in any other than the first column to another monitor, those images will be lost in case the other monitor has a different zoom such that the UI is rescaled. The reason is that the DPI change handling for TreeItem does not consider the other images of the tree item at all. This change explicitly resets all images of a tree item upon DPI change. Contributes to #3075
1 parent 9c79cf6 commit 4a95cb2

File tree

1 file changed

+5
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets

1 file changed

+5
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,6 +1815,11 @@ String getNameText () {
18151815
@Override
18161816
void handleDPIChange(Event event, float scalingFactor) {
18171817
super.handleDPIChange(event, scalingFactor);
1818+
if (images != null) {
1819+
for (int i = 1; i < images.length; i++) {
1820+
setImage(i, images[i]);
1821+
}
1822+
}
18181823
if (font != null) {
18191824
setFont(font);
18201825
}

0 commit comments

Comments
 (0)