Skip to content

Commit

Permalink
commits 14027-14029
Browse files Browse the repository at this point in the history
  • Loading branch information
scris committed Feb 8, 2024
1 parent 15a210e commit 6e7c4a3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
14 changes: 5 additions & 9 deletions SKLoupeController.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,20 @@ - (void)makeWindow {
[layer setCornerRadius:LOUPE_RADIUS];
[layer setMasksToBounds:YES];
[layer setActions:@{@"contents":[NSNull null]}];
[layer setAutoresizingMask:kCALayerWidthSizable | kCALayerHeightSizable];
[layer setFrame:NSRectToCGRect([pdfView bounds])];
if (@available(macOS 10.14, *)) {} else {
CGColorRef borderColor = CGColorCreateGenericGray(LOUPE_BORDER_GRAY, 1.0);
[layer setBorderColor:borderColor];
[layer setBorderWidth:LOUPE_BORDER_WIDTH];
CGColorRelease(borderColor);
}
[layer setDelegate:self];

window = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:[pdfView convertRectToScreen:[pdfView bounds]]];
[[window contentView] setLayer:layer];
[[window contentView] setWantsLayer:YES];
[[[window contentView] layer] addSublayer:layer];
[layer setContentsScale:[[[window contentView] layer] contentsScale]];
[window setHasShadow:YES];
[self updateColorFilters];
}

- (BOOL)layer:(CALayer *)aLayer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow *)window {
return YES;
}

- (void)handlePDFContentViewFrameChangedNotification:(NSNotification *)notification {
[self updateContents];
}
Expand Down
2 changes: 2 additions & 0 deletions SKPDFView.m
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ - (void)commonInitialization {
gestureRotation = 0.0;
gesturePageIndex = NSNotFound;

[self setEnableDataDetectors:NO];

NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited;
for (NSTrackingArea *area in [self trackingAreas]) {
if (([area options] & NSTrackingInVisibleRect))
Expand Down
1 change: 1 addition & 0 deletions SKSideWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ - (instancetype)initWithView:(NSView *)view {

NSView *backgroundView = [[SKSideWindowContentView alloc] init];

[backgroundView setWantsLayer:YES];
NSVisualEffectView *contentView = [[NSVisualEffectView alloc] init];
[contentView setMaterial:NSVisualEffectMaterialSidebar];
[self setContentView:contentView];
Expand Down

0 comments on commit 6e7c4a3

Please sign in to comment.