Skip to content

Commit

Permalink
Only add the add section menu if there are children menu items.
Browse files Browse the repository at this point in the history
  • Loading branch information
garybentley committed Oct 18, 2017
1 parent 0df7c04 commit fd23b0c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/com/quollwriter/ui/sidebars/ProjectSideBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,6 @@ public void actionPerformed (ActionEvent ev)

JMenu sm = new JMenu ("Add section" + (belowObjType != null ? " below" : ""));

m.add (sm);

for (final String sect : defSections)
{

Expand Down Expand Up @@ -1251,6 +1249,14 @@ public void actionPerformed (ActionEvent ev)

}

// Only add the section menu if there are children.
if (sm.getComponentCount () > 0)
{

m.add (sm);

}

}

}
Expand Down

0 comments on commit fd23b0c

Please sign in to comment.