mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2026-10-24 23:02:27 +00:00
Adjusting both columns.
This commit is contained in:
1 parent
876c9f14ca
commit
5d66c99cc7
1 file changed
+23
-13
+23
-13
@@ -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<Table> 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<TableItem[]> performActions = items -> {
|
||||
int total = 0;
|
||||
|
||||
Reference in new issue
Block a user