GP-6805 - Added checks for animation option

This commit is contained in:
dragonmacher
2026-05-08 16:46:20 -04:00
parent 9b9cb62ca1
commit 960ea4c074
3 changed files with 24 additions and 4 deletions
@@ -20,6 +20,7 @@ import java.awt.event.ActionListener;
import javax.swing.*; import javax.swing.*;
import docking.util.AnimationUtils;
import generic.theme.GIcon; import generic.theme.GIcon;
import ghidra.feature.vt.gui.filters.AncillaryFilterDialogComponentProvider; import ghidra.feature.vt.gui.filters.AncillaryFilterDialogComponentProvider;
@@ -49,6 +50,11 @@ public class FilterIconFlashTimer<T> extends Timer implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
if (!AnimationUtils.isAnimationEnabled()) {
stop();
return;
}
if (!filterDialog.isFiltered()) { if (!filterDialog.isFiltered()) {
stop(); stop();
return; // no filter applied return; // no filter applied
@@ -396,6 +396,14 @@ public class StatusBar extends JPanel {
} }
} }
@Override
public void start() {
if (!AnimationUtils.isAnimationEnabled()) {
return;
}
super.start();
}
@Override @Override
public void stop() { public void stop() {
super.stop(); super.stop();
@@ -23,9 +23,10 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import docking.DockingUtils; import docking.DockingUtils;
import docking.util.AnimationUtils;
import generic.theme.GColor; import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors; import generic.theme.GThemeDefaults.Colors;
import ghidra.util.SystemUtilities; import ghidra.util.Swing;
import ghidra.util.datastruct.WeakDataStructureFactory; import ghidra.util.datastruct.WeakDataStructureFactory;
import ghidra.util.datastruct.WeakSet; import ghidra.util.datastruct.WeakSet;
import ghidra.util.layout.AbstractLayoutManager; import ghidra.util.layout.AbstractLayoutManager;
@@ -372,7 +373,7 @@ public class FilterTextField extends JPanel {
// Note: this must be run on the Swing thread. When the filter button shows itself, // Note: this must be run on the Swing thread. When the filter button shows itself,
// it requires an AWT lock. If called from a non-Swing thread, deadlocks! // it requires an AWT lock. If called from a non-Swing thread, deadlocks!
SystemUtilities.runIfSwingOrPostSwingLater(() -> { Swing.runIfSwingOrRunLater(() -> {
if (showFilter) { if (showFilter) {
clearLabel.showFilterButton(); clearLabel.showFilterButton();
} }
@@ -467,6 +468,11 @@ public class FilterTextField extends JPanel {
@Override @Override
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
if (!AnimationUtils.isAnimationEnabled()) {
stop();
return;
}
if (flashCount < MAX_FLASH_COUNT) { if (flashCount < MAX_FLASH_COUNT) {
contrastColors(); contrastColors();
flashCount++; flashCount++;