Skip to content

Commit

Permalink
do not add BLANK_ICON to actions by default (fix buttons in the Searc…
Browse files Browse the repository at this point in the history
…h panel)
  • Loading branch information
dzmipt committed Dec 8, 2023
1 parent 8333a09 commit db56ac4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/studio/ui/StudioWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@ private void initActions() {
editor.setLineEnding(lineEnding);
refreshActionState();
} );
action.removeIcon();
lineEndingActions[lineEnding.ordinal()] = action;
}

Expand Down Expand Up @@ -852,6 +851,9 @@ private void addToMenu(JMenu menu, Action... actions) {
if (action == null) {
menu.addSeparator();
} else {
if (action.getValue(Action.SMALL_ICON) == null) {
action.putValue(Action.SMALL_ICON, Util.BLANK_ICON);
}
menu.add(action);
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/studio/ui/UserAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ public UserAction(String text,
putValue(ACCELERATOR_KEY,key);
}

public void removeIcon() {
putValue(SMALL_ICON, null);
}

public String getText() {
return (String)getValue(NAME);
}
Expand All @@ -46,16 +42,16 @@ public void setSelected(boolean value) {
public static UserAction create(String text,
String desc, int mnemonic,
KeyStroke key, ActionListener listener) {
return create(text, Util.BLANK_ICON, desc, mnemonic, key, listener);
return create(text, null, desc, mnemonic, key, listener);
}

public static UserAction create(String text,
String desc, int mnemonic,
ActionListener listener) {
return create(text, Util.BLANK_ICON, desc, mnemonic, null, listener);
return create(text, null, desc, mnemonic, null, listener);
}

public static UserAction create(String text, ActionListener listener) {
return create(text, Util.BLANK_ICON, null, 0, null, listener);
return create(text, null, null, 0, null, listener);
}
}

0 comments on commit db56ac4

Please sign in to comment.