Skip to content

Commit 4b57615

Browse files
akoch-yattaHeikoKlare
authored andcommitted
[win32] Prevent event on table column resize
This commit prevents the creation of a SWT.Resize event when table columns are resized after a zoom change. Therefore, the ignoreColumnResize is utilized during the resizing to disable the creation of the resize event. Contributes to #62 and #127
1 parent 08e2cad commit 4b57615

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,13 @@ private static void handleDPIChange(Widget widget, int newZoom, float scalingFac
891891
if (!(widget instanceof TableColumn tableColumn)) {
892892
return;
893893
}
894+
Table table = tableColumn.getParent();
895+
boolean ignoreColumnResize = table.ignoreColumnResize;
896+
table.ignoreColumnResize = true;
894897
final int newColumnWidth = Math.round(tableColumn.getWidthInPixels() * scalingFactor);
895898
tableColumn.setWidthInPixels(newColumnWidth);
899+
table.ignoreColumnResize = ignoreColumnResize;
900+
896901
Image image = tableColumn.getImage();
897902
if (image != null) {
898903
tableColumn.setImage(image);

0 commit comments

Comments
 (0)