UI fixed brief mode

This commit is contained in:
Radek Davidek 2026-05-19 10:23:05 +02:00
parent 868b33f175
commit ddcd4a03b8

View File

@ -1464,7 +1464,8 @@ public class FilePanelTab extends JPanel {
}
private void scrollBriefCellToColumnStart(int row, int column) {
if (fileTable == null || viewMode != ViewMode.BRIEF || row < 0 || column < 0) {
if (fileTable == null || viewMode != ViewMode.BRIEF || row < 0 || column < 0
|| column >= fileTable.getColumnModel().getColumnCount()) {
return;
}
@ -1478,7 +1479,10 @@ public class FilePanelTab extends JPanel {
int maxY = Math.max(0, viewHeight - viewport.getHeight());
Point position = viewport.getViewPosition();
int targetX = Math.max(0, Math.min(cell.x, maxX));
Rectangle visible = viewport.getViewRect();
int columnWidth = fileTable.getColumnModel().getColumn(column).getWidth();
boolean wholeColumnVisible = cell.x >= visible.x && cell.x + columnWidth <= visible.x + visible.width;
int targetX = wholeColumnVisible ? position.x : Math.max(0, Math.min(cell.x, maxX));
int targetY = position.y;
if (cell.y < position.y) {
targetY = cell.y;