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 docking.util.AnimationUtils;
import generic.theme.GIcon;
import ghidra.feature.vt.gui.filters.AncillaryFilterDialogComponentProvider;
@@ -49,6 +50,11 @@ public class FilterIconFlashTimer<T> extends Timer implements ActionListener {
@Override
public void actionPerformed(ActionEvent event) {
if (!AnimationUtils.isAnimationEnabled()) {
stop();
return;
}
if (!filterDialog.isFiltered()) {
stop();
return; // no filter applied
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -396,6 +396,14 @@ public class StatusBar extends JPanel {
}
}
@Override
public void start() {
if (!AnimationUtils.isAnimationEnabled()) {
return;
}
super.start();
}
@Override
public void stop() {
super.stop();
@@ -23,9 +23,10 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import docking.DockingUtils;
import docking.util.AnimationUtils;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors;
import ghidra.util.SystemUtilities;
import ghidra.util.Swing;
import ghidra.util.datastruct.WeakDataStructureFactory;
import ghidra.util.datastruct.WeakSet;
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,
// it requires an AWT lock. If called from a non-Swing thread, deadlocks!
SystemUtilities.runIfSwingOrPostSwingLater(() -> {
Swing.runIfSwingOrRunLater(() -> {
if (showFilter) {
clearLabel.showFilterButton();
}
@@ -467,6 +468,11 @@ public class FilterTextField extends JPanel {
@Override
public void actionPerformed(ActionEvent event) {
if (!AnimationUtils.isAnimationEnabled()) {
stop();
return;
}
if (flashCount < MAX_FLASH_COUNT) {
contrastColors();
flashCount++;