Skip to content

Commit

Permalink
[win32] Prevent event on table column resize
Browse files Browse the repository at this point in the history
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
  • Loading branch information
akoch-yatta authored and HeikoKlare committed Aug 9, 2024
1 parent 08e2cad commit 4b57615
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,13 @@ private static void handleDPIChange(Widget widget, int newZoom, float scalingFac
if (!(widget instanceof TableColumn tableColumn)) {
return;
}
Table table = tableColumn.getParent();
boolean ignoreColumnResize = table.ignoreColumnResize;
table.ignoreColumnResize = true;
final int newColumnWidth = Math.round(tableColumn.getWidthInPixels() * scalingFactor);
tableColumn.setWidthInPixels(newColumnWidth);
table.ignoreColumnResize = ignoreColumnResize;

Image image = tableColumn.getImage();
if (image != null) {
tableColumn.setImage(image);
Expand Down

0 comments on commit 4b57615

Please sign in to comment.