mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Prevent updating item manager view if filters didn't change
Focus item manager when Deck Editor opened and when filters hidden/shown
This commit is contained in:
@@ -472,6 +472,13 @@ public enum CDeckEditorUI implements ICDoc {
|
||||
catView.setWantUnique(wantUnique);
|
||||
deckView.setWantUnique(wantUnique);
|
||||
catView.applyFilters();
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
catView.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private class _FindAsYouType extends KeyAdapter {
|
||||
|
||||
@@ -211,6 +211,12 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel {
|
||||
@Override
|
||||
public void run() {
|
||||
setHideFilters(!getHideFilters());
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -708,8 +714,10 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel {
|
||||
predicates.add(mainSearchFilter.buildPredicate(this.genericType));
|
||||
}
|
||||
|
||||
this.filterPredicate = predicates.size() == 0 ? null : Predicates.and(predicates);
|
||||
Predicate<? super T> newFilterPredicate = predicates.size() == 0 ? null : Predicates.and(predicates);
|
||||
if (this.filterPredicate == newFilterPredicate) { return; }
|
||||
|
||||
this.filterPredicate = newFilterPredicate;
|
||||
if (this.pool != null) {
|
||||
this.updateView(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user