Skip to content

Commit 8593132

Browse files
ShahzaibIbrahimHeikoKlare
authored andcommitted
Correctly reposition items of ExpandBar during DPI change
When using the monitor-specific rescaling functionality on Windows, moving a shell between monitors with different zoom levels (no matter which zoom levels they are), the images, expand items and texts are not drawn at correct coordinates. This change fixes the behavior to perform an appropriate layout update of the ExpandBar.
1 parent a26b66a commit 8593132

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ private static void handleDPIChange(Widget widget, int newZoom, float scalingFac
878878
for (ExpandItem item : expandBar.getItems()) {
879879
DPIZoomChangeRegistry.applyChange(item, newZoom, scalingFactor);
880880
}
881+
expandBar.layoutItems(0, true);
881882
expandBar.redraw();
882883
}
883884
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ private static void handleDPIChange(Widget widget, int newZoom, float scalingFac
539539
if (item.height != 0 || item.width != 0) {
540540
int newWidth = Math.round(item.width * scalingFactor);
541541
int newHeight = Math.round(item.height * scalingFactor);
542-
item.setBoundsInPixels(item.x, item.y, newWidth, newHeight, false, true);
542+
item.setBoundsInPixels(item.x, item.y, newWidth, newHeight, true, true);
543543
}
544544
}
545545
}

0 commit comments

Comments
 (0)