Skip to content

Commit

Permalink
Merge pull request #12776 from BrentEaston/12773-Unused-Icon-image
Browse files Browse the repository at this point in the history
12773 - Don't show disabled Toolbar Button icons in unused images list
  • Loading branch information
uckelman authored Oct 3, 2023
2 parents cd5d405 + 22feb86 commit bd5ffd5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions vassal-app/src/main/java/VASSAL/build/AbstractToolbarItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public Command getRestoreCommand() {
* If this component is ALSO an {@link AbstractConfigurable}, then this list of attributes determines the appropriate
* attribute order for {@link AbstractConfigurable#getAttributeDescriptions()} and {@link AbstractConfigurable#getAttributeTypes()}.
*
* @return a list of all buildFile (XML) attribute names for this component
* @return an array of all buildFile (XML) attribute names for this component
*/
@Override
public String[] getAttributeNames() {
Expand Down Expand Up @@ -388,7 +388,7 @@ public Configurer getConfigurer(AutoConfigurable c, String key, String name) {
/**
* Classes extending AbstractToolbarItem can call this as a super() method after checking for their own keys, to
* avoid needing to deal with the nitty gritty of the toolbar button.
*
* <p>
* Sets a buildFile (XML) attribute value for this component. The <code>key</code> parameter will be one of those listed in {@link #getAttributeNames}.
* If the <code>value</code> parameter is a String, it will be the value returned by {@link #getAttributeValueString} for the same
* <code>key</code>. If the implementing class extends {@link AbstractConfigurable}, then <code>value</code> will be an instance of
Expand Down Expand Up @@ -575,8 +575,13 @@ public List<NamedKeyStroke> getNamedKeyStrokeList() {
@Override
public void addLocalImageNames(Collection<String> s) {
final String string = launch.getAttributeValueString(launch.getIconAttribute());
if (string != null) { // Launch buttons sometimes have null icon attributes - yay
if (string != null && !string.isEmpty()) { // Launch buttons sometimes have null icon attributes - yay
s.add(string);
}
final String disabledIconName = disabledIconConfig.getValueString();
if (disabledIconName != null && !disabledIconName.isEmpty()) {
s.add(disabledIconName);
}

}
}

0 comments on commit bd5ffd5

Please sign in to comment.