Skip to content

Commit ff42d3a

Browse files
committed
Resize item height when a tree has a MeasureItem hook
1 parent c8d98fb commit ff42d3a

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/Tree.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8287,6 +8287,11 @@ private static void handleDPIChange(Widget widget, int newZoom, float scalingFac
82878287
tree.imageList = null;
82888288
}
82898289

8290+
if (tree.hooks(SWT.MeasureItem)) {
8291+
// with the measure item hook, the height must be programmatically recalculated
8292+
var itemHeight = tree.getItemHeightInPixels();
8293+
tree.setItemHeight(Math.round(itemHeight * scalingFactor));
8294+
}
82908295
for (TreeColumn treeColumn : tree.getColumns()) {
82918296
DPIZoomChangeRegistry.applyChange(treeColumn, newZoom, scalingFactor);
82928297
}

0 commit comments

Comments
 (0)