diff --git a/lib/ac-swt-common/src/main/java/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java b/lib/ac-swt-common/src/main/java/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java index fb5d2e57..ce3883b9 100644 --- a/lib/ac-swt-common/src/main/java/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java +++ b/lib/ac-swt-common/src/main/java/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java @@ -1978,19 +1978,6 @@ public class DiskExplorerTab { } }); - // Adjust column size -- and make certain none are more than 2x the average (trying to prevent super wide screens) - int columnWidthTotal = 0; - for (TableColumn column : actionTable.getColumns()) { - column.pack(); - columnWidthTotal += column.getWidth(); - } - int columnWidthAvg = columnWidthTotal / actionTable.getColumns().length; - for (TableColumn column : actionTable.getColumns()) { - if (column.getWidth() > columnWidthAvg * 2) { - column.setWidth(columnWidthAvg * 2); - } - } - // Informational tab CTabItem informational = new CTabItem(tabFolder, SWT.NONE); informational.setText("Informational"); @@ -2017,6 +2004,29 @@ public class DiskExplorerTab { } }); + // If we have nothing to fix, show the informational tab instead + if (fixable == 0) { + tabFolder.setSelection(informational); + } + + // Adjust column size -- and make certain none are more than 2x the average (trying to prevent super wide screens) + // Note: Same logic applied to both tabs + Consumer adjustColumns = table -> { + int columnWidthTotal = 0; + for (TableColumn column : table.getColumns()) { + column.pack(); + columnWidthTotal += column.getWidth(); + } + int columnWidthAvg = columnWidthTotal / table.getColumns().length; + for (TableColumn column : table.getColumns()) { + if (column.getWidth() > columnWidthAvg * 2) { + column.setWidth(columnWidthAvg * 2); + } + } + }; + adjustColumns.accept(actionTable); + adjustColumns.accept(infoTable); + // Common processing Consumer performActions = items -> { int total = 0;