mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
isGraphite() Handle exceptions from Foundation
This commit is contained in:
@@ -76,8 +76,12 @@ public class IntelliJLaf extends DarculaLaf {
|
||||
}
|
||||
|
||||
public static boolean isGraphite() {
|
||||
// https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCell_Class/index.html#//apple_ref/doc/c_ref/NSGraphiteControlTint
|
||||
// NSGraphiteControlTint = 6
|
||||
return Foundation.invoke("NSColor", "currentControlTint").intValue() == 6;
|
||||
try {
|
||||
// https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCell_Class/index.html#//apple_ref/doc/c_ref/NSGraphiteControlTint
|
||||
// NSGraphiteControlTint = 6
|
||||
return Foundation.invoke("NSColor", "currentControlTint").intValue() == 6;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user