Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/org/jetuml/gui/EditorFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public EditorFrame(Stage pMainStage, Stage pDialogStage) {
aRecentFiles.deserialize(Preferences.userNodeForPackage(JetUML.class).get("recent", "").trim());

MenuBar menuBar = new MenuBar();
moveMenuBarToMacNativeMenuBar(menuBar);
setTop(menuBar);

TabPane tabPane = new TabPane();
Expand Down Expand Up @@ -146,6 +147,19 @@ private static String[] validFormats(String... pDesiredFormats) {
}
return validFormats.toArray(new String[validFormats.size()]);
}

/*
* Moves the menu bar to the system menu bar on macOS systems.
* A macOS system is indicated by the string "Mac OS X" in
* System property `os.name`.
*/
private void moveMenuBarToMacNativeMenuBar(MenuBar pMenuBar)
{
if (System.getProperty("os.name").equals("Mac OS X"))
{
pMenuBar.setUseSystemMenuBar(true);
}
}

/*
* Traverses all menu items up to the second level (top level
Expand Down