Skip to content

Commit 0071da4

Browse files
amartya4256fedejeanne
authored andcommitted
Reset Table::itemHeight on DPI change #62
This commit resets the Table::itemHeight to -1 on DPI change to make sure that TableItem's height is still managed by the OS as it can be changed by CDDS_SUBITEMPREPAINT callback and once it is changed to some value, it will always remain the same and not recalculated by the OS leading to inconsistent behaviour on different zooms. contributes to #62 and #127
1 parent 69e6d9c commit 0071da4

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7357,6 +7357,12 @@ private static void handleDPIChange(Widget widget, int newZoom, float scalingFac
73577357
table.imageList = null;
73587358
}
73597359

7360+
// if the item height was set at least once programmatically with CDDS_SUBITEMPREPAINT,
7361+
// the item height of the table is not managed by the OS anymore e.g. when the zoom
7362+
// on the monitor is changed, the height of the item will stay at the fixed size.
7363+
// Resetting it will re-enable the default behavior again
7364+
table.setItemHeight(-1);
7365+
73607366
for (TableItem item : table.getItems()) {
73617367
DPIZoomChangeRegistry.applyChange(item, newZoom, scalingFactor);
73627368
}

0 commit comments

Comments
 (0)