File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
arduino-core/src/processing/app/helpers Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -971,7 +971,7 @@ public boolean handleQuit() {
971971 // Save out the current prefs state
972972 PreferencesData .save ();
973973
974- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
974+ if (!OSUtils .hasMacOSStyleMenus () ) {
975975 // If this was fired from the menu or an AppleEvent (the Finder),
976976 // then Mac OS X will send the terminate signal itself.
977977 System .exit (0 );
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ public void actionPerformed(ActionEvent e) {
619619 fileMenu .add (item );
620620
621621 // macosx already has its own preferences and quit menu
622- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
622+ if (!OSUtils .hasMacOSStyleMenus () ) {
623623 fileMenu .addSeparator ();
624624
625625 item = newJMenuItem (tr ("Preferences" ), ',' );
@@ -1252,7 +1252,7 @@ public void actionPerformed(ActionEvent e) {
12521252 menu .add (item );
12531253
12541254 // macosx already has its own about menu
1255- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
1255+ if (!OSUtils .hasMacOSStyleMenus () ) {
12561256 menu .addSeparator ();
12571257 item = new JMenuItem (tr ("About Arduino" ));
12581258 item .addActionListener (new ActionListener () {
@@ -1812,7 +1812,7 @@ protected boolean checkModified() {
18121812 String prompt = I18n .format (tr ("Save changes to \" {0}\" ? " ),
18131813 sketch .getName ());
18141814
1815- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
1815+ if (!OSUtils .hasMacOSStyleMenus () ) {
18161816 int result =
18171817 JOptionPane .showConfirmDialog (this , prompt , tr ("Close" ),
18181818 JOptionPane .YES_NO_CANCEL_OPTION ,
Original file line number Diff line number Diff line change @@ -26,4 +26,7 @@ static public boolean isMacOS() {
2626 return System .getProperty ("os.name" ).contains ("Mac" );
2727 }
2828
29+ static public boolean hasMacOSStyleMenus () {
30+ return OSUtils .isMacOS () && System .getProperty ("apple.laf.useScreenMenuBar" ).equals ("true" );
31+ }
2932}
You can’t perform that action at this time.
0 commit comments