mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-21 12:29:23 +01:00
Only display touch bar on macOS 10.12 and higher (#8281)
This commit is contained in:
parent
30e1466590
commit
b3b62d0c44
@ -31,6 +31,7 @@ import com.thizzer.jtouchbar.JTouchBar;
|
||||
import com.thizzer.jtouchbar.item.TouchBarItem;
|
||||
import com.thizzer.jtouchbar.item.view.TouchBarButton;
|
||||
|
||||
import cc.arduino.contributions.VersionComparator;
|
||||
import processing.app.helpers.OSUtils;
|
||||
|
||||
import java.awt.*;
|
||||
@ -149,7 +150,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
|
||||
statusFont = Theme.getFont("buttons.status.font");
|
||||
statusColor = Theme.getColor("buttons.status.color");
|
||||
|
||||
if (OSUtils.isMacOS()) {
|
||||
if (OSUtils.isMacOS() && VersionComparator.greaterThanOrEqual(OSUtils.version(), "10.12")) {
|
||||
editor.addWindowListener(new WindowAdapter() {
|
||||
public void windowActivated(WindowEvent e) {
|
||||
if (touchBar == null) {
|
||||
|
@ -61,6 +61,10 @@ public class VersionComparator implements Comparator<String> {
|
||||
public static boolean greaterThan(String a, String b) {
|
||||
return compareTo(a, b) > 0;
|
||||
}
|
||||
|
||||
public static boolean greaterThanOrEqual(String a, String b) {
|
||||
return compareTo(a, b) >= 0;
|
||||
}
|
||||
|
||||
public static String max(String a, String b) {
|
||||
return greaterThan(a, b) ? a : b;
|
||||
|
@ -29,4 +29,8 @@ public class OSUtils {
|
||||
static public boolean hasMacOSStyleMenus() {
|
||||
return OSUtils.isMacOS() && "true".equals(System.getProperty("apple.laf.useScreenMenuBar"));
|
||||
}
|
||||
|
||||
static public String version() {
|
||||
return System.getProperty("os.version");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user