mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
macOS native rounded borders: (PR #772)
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (23, ) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
Native Libraries / Natives (macos) (push) Has been cancelled
Native Libraries / Natives (ubuntu) (push) Has been cancelled
Native Libraries / Natives (windows) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
Some checks failed
CI / build (11, ) (push) Has been cancelled
CI / build (17, ) (push) Has been cancelled
CI / build (21, ) (push) Has been cancelled
CI / build (23, ) (push) Has been cancelled
CI / build (8, ) (push) Has been cancelled
Native Libraries / Natives (macos) (push) Has been cancelled
Native Libraries / Natives (ubuntu) (push) Has been cancelled
Native Libraries / Natives (windows) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
- removed opacity from contentView.layer - catch and log exceptions
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -29,15 +29,21 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define JNI_COCOA_TRY() \
|
||||
@try {
|
||||
|
||||
#define JNI_COCOA_CATCH() \
|
||||
} @catch( NSException *ex ) { \
|
||||
NSLog( @"Exception: %@\nReason: %@\nUser Info: %@\nStack: %@", \
|
||||
[ex name], [ex reason], [ex userInfo], [ex callStackSymbols] ); \
|
||||
}
|
||||
|
||||
#define JNI_COCOA_ENTER() \
|
||||
@autoreleasepool { \
|
||||
@try {
|
||||
JNI_COCOA_TRY()
|
||||
|
||||
#define JNI_COCOA_EXIT() \
|
||||
} @catch( NSException *ex ) { \
|
||||
NSLog( @"Exception: %@\nReason: %@\nUser Info: %@\nStack: %@", \
|
||||
[ex name], [ex reason], [ex userInfo], [ex callStackSymbols] ); \
|
||||
} \
|
||||
JNI_COCOA_CATCH() \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -100,10 +100,13 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
||||
return FALSE;
|
||||
|
||||
[FlatJNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
|
||||
JNI_COCOA_TRY()
|
||||
|
||||
nsWindow.hasShadow = YES;
|
||||
nsWindow.contentView.wantsLayer = YES;
|
||||
nsWindow.contentView.layer.cornerRadius = radius;
|
||||
nsWindow.contentView.layer.masksToBounds = YES;
|
||||
nsWindow.contentView.layer.opaque = NO;
|
||||
|
||||
nsWindow.contentView.layer.borderWidth = borderWidth;
|
||||
if( borderWidth > 0 ) {
|
||||
@@ -120,6 +123,8 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
||||
|
||||
[nsWindow.contentView.layer removeAllAnimations];
|
||||
[nsWindow invalidateShadow];
|
||||
|
||||
JNI_COCOA_CATCH()
|
||||
}];
|
||||
|
||||
return TRUE;
|
||||
@@ -157,6 +162,8 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
||||
WindowData* windowData = getWindowData( nsWindow, true );
|
||||
|
||||
[FlatJNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
|
||||
JNI_COCOA_TRY()
|
||||
|
||||
// NSLog( @"\n%@\n\n", [nsWindow.contentView.superview _subtreeDescription] );
|
||||
|
||||
// add/remove toolbar
|
||||
@@ -235,6 +242,8 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
||||
windowData.didExitFullScreenObserver = nil;
|
||||
}
|
||||
}
|
||||
|
||||
JNI_COCOA_CATCH()
|
||||
}];
|
||||
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user