Skip to content

Commit

Permalink
fix bug where menubar controller was not notified when first menu ite…
Browse files Browse the repository at this point in the history
…m of a menu is selected
  • Loading branch information
creme332 committed Jun 13, 2024
1 parent 7d439ec commit c5b64e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/github/creme332/model/MenuModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public MenuItemModel getActiveItem() {

public void setActiveItem(int i) {
MenuItemModel newActiveItem = items[i];
support.firePropertyChange("modeChange", activeItem.getMode(), newActiveItem.getMode());

// Note: Keep OldValue = null to always fire property change when mode changes.
// If OldValue = NewValue, no event is fired.
support.firePropertyChange("modeChange", null, newActiveItem.getMode());

activeItem = newActiveItem;
}
Expand Down

0 comments on commit c5b64e6

Please sign in to comment.