mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-19 08:52:15 +01:00
Fix macOS 10.13 missing menubar
The global bar is being used if locale is English and About() menu is present
This commit is contained in:
parent
7c27d09c6f
commit
a2b5f661b8
@ -133,6 +133,10 @@ public class Base {
|
|||||||
System.setProperty("java.net.useSystemProxies", "true");
|
System.setProperty("java.net.useSystemProxies", "true");
|
||||||
|
|
||||||
if (OSUtils.isMacOS()) {
|
if (OSUtils.isMacOS()) {
|
||||||
|
System.setProperty("apple.laf.useScreenMenuBar",
|
||||||
|
String.valueOf(!System.getProperty("os.version").startsWith("10.13")
|
||||||
|
|| com.apple.eawt.Application.getApplication().isAboutMenuItemPresent()));
|
||||||
|
|
||||||
ThinkDifferent.init();
|
ThinkDifferent.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,7 +619,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
fileMenu.add(item);
|
fileMenu.add(item);
|
||||||
|
|
||||||
// macosx already has its own preferences and quit menu
|
// macosx already has its own preferences and quit menu
|
||||||
if (!OSUtils.isMacOS()) {
|
if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") {
|
||||||
fileMenu.addSeparator();
|
fileMenu.addSeparator();
|
||||||
|
|
||||||
item = newJMenuItem(tr("Preferences"), ',');
|
item = newJMenuItem(tr("Preferences"), ',');
|
||||||
@ -1252,7 +1252,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
menu.add(item);
|
menu.add(item);
|
||||||
|
|
||||||
// macosx already has its own about menu
|
// macosx already has its own about menu
|
||||||
if (!OSUtils.isMacOS()) {
|
if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") {
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
item = new JMenuItem(tr("About Arduino"));
|
item = new JMenuItem(tr("About Arduino"));
|
||||||
item.addActionListener(new ActionListener() {
|
item.addActionListener(new ActionListener() {
|
||||||
@ -1812,7 +1812,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
String prompt = I18n.format(tr("Save changes to \"{0}\"? "),
|
String prompt = I18n.format(tr("Save changes to \"{0}\"? "),
|
||||||
sketch.getName());
|
sketch.getName());
|
||||||
|
|
||||||
if (!OSUtils.isMacOS()) {
|
if (!OSUtils.isMacOS() || System.getProperty("apple.laf.useScreenMenuBar") == "false") {
|
||||||
int result =
|
int result =
|
||||||
JOptionPane.showConfirmDialog(this, prompt, tr("Close"),
|
JOptionPane.showConfirmDialog(this, prompt, tr("Close"),
|
||||||
JOptionPane.YES_NO_CANCEL_OPTION,
|
JOptionPane.YES_NO_CANCEL_OPTION,
|
||||||
|
@ -62,9 +62,6 @@ public class Platform extends processing.app.Platform {
|
|||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
System.setProperty("apple.laf.useScreenMenuBar", "true");
|
|
||||||
|
|
||||||
discoverRealOsArch();
|
discoverRealOsArch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user