mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-03 06:58:32 +07:00
[vcs] Preselect nothing in ChangesTreeList by default
On Show Diff, the ChangesTreeList limits files shown in diff to the selected folder. Thus if the first row is preselected (as it were before), and commit changes files in different folders, automatic Show Diff from the log table doesn't show everything, but only files from the first root node which is confusing. => if there is nothing to select by default, don't select the first row.
This commit is contained in:
@@ -364,7 +364,7 @@ public abstract class ChangesTreeList<T> extends JPanel implements TypeSafeDataP
|
||||
TreeUtil.expandAll(myTree);
|
||||
|
||||
int listSelection = 0;
|
||||
int scrollRow = 0;
|
||||
int scrollRow = -1;
|
||||
|
||||
if (myShowCheckboxes) {
|
||||
if (myIncludedChanges.size() > 0) {
|
||||
@@ -421,7 +421,7 @@ public abstract class ChangesTreeList<T> extends JPanel implements TypeSafeDataP
|
||||
return rowToSelect[0] == -1;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
scrollRow = rowToSelect[0] == -1 ? scrollRow : rowToSelect[0];
|
||||
}
|
||||
}
|
||||
@@ -430,7 +430,9 @@ public abstract class ChangesTreeList<T> extends JPanel implements TypeSafeDataP
|
||||
myList.setSelectedIndex(listSelection);
|
||||
myList.ensureIndexIsVisible(listSelection);
|
||||
|
||||
myTree.setSelectionRow(scrollRow);
|
||||
if (scrollRow >= 0) {
|
||||
myTree.setSelectionRow(scrollRow);
|
||||
}
|
||||
TreeUtil.showRowCentered(myTree, scrollRow, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user