Skip to content

Commit

Permalink
macOS native libarary: added logs to Java_com_formdev_flatlaf_ui_Flat…
Browse files Browse the repository at this point in the history
…NativeMacLibrary_setWindowRoundedBorder()

for apache/netbeans#7560
  • Loading branch information
DevCharly committed Jul 14, 2024
1 parent 72a4c00 commit d6a9e89
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,41 @@ @implementation WindowData
if( nsWindow == NULL )
return FALSE;

[FlatJNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
NSLog( @"---- setWindowRoundedBorder BEGIN ----" );

[FlatJNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
NSLog( @"nsWindow.hasShadow = YES" );
nsWindow.hasShadow = YES;
NSLog( @"nsWindow.contentView.wantsLayer = YES" );
nsWindow.contentView.wantsLayer = YES;
NSLog( @"nsWindow.contentView.layer: %@", nsWindow.contentView.layer );
NSLog( @"nsWindow.contentView.layer.cornerRadius = %f", radius );
nsWindow.contentView.layer.cornerRadius = radius;
NSLog( @"nsWindow.contentView.layer.masksToBounds = YES" );
nsWindow.contentView.layer.masksToBounds = YES;

NSLog( @"nsWindow.contentView.layer.borderWidth = %f", borderWidth );
nsWindow.contentView.layer.borderWidth = borderWidth;
if( borderWidth > 0 ) {
CGFloat red = ((borderColor >> 16) & 0xff) / 255.;
CGFloat green = ((borderColor >> 8) & 0xff) / 255.;
CGFloat blue = (borderColor & 0xff) / 255.;
CGFloat alpha = ((borderColor >> 24) & 0xff) / 255.;

NSLog( @"nsWindow.contentView.layer.borderColor" );
nsWindow.contentView.layer.borderColor = [[NSColor colorWithDeviceRed:red green:green blue:blue alpha:alpha] CGColor];
}

NSLog( @"nsWindow.backgroundColor = NSColor.clearColor" );
nsWindow.backgroundColor = NSColor.clearColor;
NSLog( @"nsWindow.opaque = NO" );
nsWindow.opaque = NO;

NSLog( @"nsWindow.contentView.layer removeAllAnimations" );
[nsWindow.contentView.layer removeAllAnimations];
NSLog( @"nsWindow invalidateShadow" );
[nsWindow invalidateShadow];
NSLog( @"---- setWindowRoundedBorder END ----" );
}];

return TRUE;
Expand Down

0 comments on commit d6a9e89

Please sign in to comment.