mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] when filters change, recalculate columns size
When filters change, commits with author with longer names can become visible. This often leads to author column being too small. So need to recalculate preferred size in this case. This of course creates a new problem: if user resizes a column, it should not be automatically adjusted. This is going to be fixed in later commits.
This commit is contained in:
@@ -153,6 +153,8 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider,
|
||||
|
||||
public void updateDataPack(@NotNull VisiblePack visiblePack, boolean permGraphChanged) {
|
||||
VcsLogGraphTable.Selection previousSelection = getSelection();
|
||||
boolean filtersChanged = !getModel().getVisiblePack().getFilters().equals(visiblePack.getFilters());
|
||||
|
||||
getModel().setVisiblePack(visiblePack);
|
||||
previousSelection.restore(visiblePack.getVisibleGraph(), true, permGraphChanged);
|
||||
for (VcsLogHighlighter highlighter : myHighlighters) {
|
||||
@@ -160,12 +162,11 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider,
|
||||
}
|
||||
|
||||
setPaintBusy(false);
|
||||
doLayout();
|
||||
reLayout(filtersChanged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doLayout() {
|
||||
if (!myColumnsSizeInitialized) {
|
||||
public void reLayout(boolean recalculatePreferredSize) {
|
||||
if (!myColumnsSizeInitialized || recalculatePreferredSize) {
|
||||
myColumnsSizeInitialized = initFixedColumnsPreferredSize();
|
||||
}
|
||||
updateCommitColumnWidth();
|
||||
@@ -173,6 +174,11 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider,
|
||||
super.doLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doLayout() {
|
||||
reLayout(false);
|
||||
}
|
||||
|
||||
private boolean initFixedColumnsPreferredSize() {
|
||||
Font tableFont = getTableFont();
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public class VcsLogUiUtil {
|
||||
@NotNull VcsLogData logData,
|
||||
@NotNull Disposable disposableParent) {
|
||||
Runnable miniDetailsLoadedListener = () -> {
|
||||
graphTable.doLayout();
|
||||
graphTable.reLayout(false);
|
||||
graphTable.repaint();
|
||||
};
|
||||
Runnable containingBranchesListener = () -> {
|
||||
|
||||
Reference in New Issue
Block a user