mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define JNI_COCOA_ENTER() \
|
#define JNI_COCOA_TRY() \
|
||||||
@autoreleasepool { \
|
|
||||||
@try {
|
@try {
|
||||||
|
|
||||||
#define JNI_COCOA_EXIT() \
|
#define JNI_COCOA_CATCH() \
|
||||||
} @catch( NSException *ex ) { \
|
} @catch( NSException *ex ) { \
|
||||||
NSLog( @"Exception: %@\nReason: %@\nUser Info: %@\nStack: %@", \
|
NSLog( @"Exception: %@\nReason: %@\nUser Info: %@\nStack: %@", \
|
||||||
[ex name], [ex reason], [ex userInfo], [ex callStackSymbols] ); \
|
[ex name], [ex reason], [ex userInfo], [ex callStackSymbols] ); \
|
||||||
} \
|
}
|
||||||
|
|
||||||
|
#define JNI_COCOA_ENTER() \
|
||||||
|
@autoreleasepool { \
|
||||||
|
JNI_COCOA_TRY()
|
||||||
|
|
||||||
|
#define JNI_COCOA_EXIT() \
|
||||||
|
JNI_COCOA_CATCH() \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -100,10 +100,13 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
[FlatJNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
|
[FlatJNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
|
||||||
|
JNI_COCOA_TRY()
|
||||||
|
|
||||||
nsWindow.hasShadow = YES;
|
nsWindow.hasShadow = YES;
|
||||||
nsWindow.contentView.wantsLayer = YES;
|
nsWindow.contentView.wantsLayer = YES;
|
||||||
nsWindow.contentView.layer.cornerRadius = radius;
|
nsWindow.contentView.layer.cornerRadius = radius;
|
||||||
nsWindow.contentView.layer.masksToBounds = YES;
|
nsWindow.contentView.layer.masksToBounds = YES;
|
||||||
|
nsWindow.contentView.layer.opaque = NO;
|
||||||
|
|
||||||
nsWindow.contentView.layer.borderWidth = borderWidth;
|
nsWindow.contentView.layer.borderWidth = borderWidth;
|
||||||
if( borderWidth > 0 ) {
|
if( borderWidth > 0 ) {
|
||||||
@@ -120,6 +123,8 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
|||||||
|
|
||||||
[nsWindow.contentView.layer removeAllAnimations];
|
[nsWindow.contentView.layer removeAllAnimations];
|
||||||
[nsWindow invalidateShadow];
|
[nsWindow invalidateShadow];
|
||||||
|
|
||||||
|
JNI_COCOA_CATCH()
|
||||||
}];
|
}];
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -157,6 +162,8 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
|||||||
WindowData* windowData = getWindowData( nsWindow, true );
|
WindowData* windowData = getWindowData( nsWindow, true );
|
||||||
|
|
||||||
[FlatJNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
|
[FlatJNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
|
||||||
|
JNI_COCOA_TRY()
|
||||||
|
|
||||||
// NSLog( @"\n%@\n\n", [nsWindow.contentView.superview _subtreeDescription] );
|
// NSLog( @"\n%@\n\n", [nsWindow.contentView.superview _subtreeDescription] );
|
||||||
|
|
||||||
// add/remove toolbar
|
// add/remove toolbar
|
||||||
@@ -235,6 +242,8 @@ JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeMacLibrary_setW
|
|||||||
windowData.didExitFullScreenObserver = nil;
|
windowData.didExitFullScreenObserver = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNI_COCOA_CATCH()
|
||||||
}];
|
}];
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user