Revision: 15196
http://sourceforge.net/p/skim-app/code/15196
Author: hofman
Date: 2025-05-12 14:44:23 +0000 (Mon, 12 May 2025)
Log Message:
-----------
use macros for some constants
Modified Paths:
--------------
trunk/SKPresentationOptionsSheetController.m
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:33:10 UTC
(rev 15195)
+++ trunk/SKPresentationOptionsSheetController.m 2025-05-12 14:44:23 UTC
(rev 15196)
@@ -68,6 +68,8 @@
#define TABLE_OFFSET 28.0
#define BOX_OFFSET 20.0
+#define PREVIEW_INSET 6.0
+#define PREVIEW_CORNER_RADIUS 6.0
#define PREVIEW_DELAY 1.0
static char *SKTransitionPropertiesObservationContext;
@@ -321,8 +323,8 @@
return;
NSRect rect = [[[self window] screen] frame];
- rect.size.width = round(0.5 * NSWidth(rect)) + 12.0;
- rect.size.height = round(0.5 * NSHeight(rect)) + 34.0;
+ rect.size.width = round(0.5 * NSWidth(rect)) + 2.0 * PREVIEW_INSET;
+ rect.size.height = round(0.5 * NSHeight(rect)) + PREVIEW_INSET + 28.0;
if (previewWindow == nil) {
previewWindow = [[NSPanel alloc] initWithContentRect:rect
styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView
backing:NSBackingStoreBuffered defer:NO screen:[[self window] screen]];
@@ -344,7 +346,7 @@
NSView *bgView = [[NSView alloc] init];
CALayer *layer = [CALayer layer];
[layer setBackgroundColor:CGColorGetConstantColor(kCGColorBlack)];
- [layer setCornerRadius:6.0];
+ [layer setCornerRadius:PREVIEW_CORNER_RADIUS];
[bgView setLayer:layer];
[bgView setWantsLayer:YES];
[bgView
setLayerContentsRedrawPolicy:NSViewLayerContentsRedrawDuringViewResize];
@@ -351,10 +353,10 @@
[bgView setTranslatesAutoresizingMaskIntoConstraints:NO];
[contentView addSubview:bgView];
NSArray *constraints = @[
- [[bgView leadingAnchor] constraintEqualToAnchor:[contentView
leadingAnchor] constant:6.0],
- [[contentView trailingAnchor] constraintEqualToAnchor:[bgView
trailingAnchor] constant:6.0],
+ [[bgView leadingAnchor] constraintEqualToAnchor:[contentView
leadingAnchor] constant:PREVIEW_INSET],
+ [[contentView trailingAnchor] constraintEqualToAnchor:[bgView
trailingAnchor] constant:PREVIEW_INSET],
[[bgView topAnchor] constraintEqualToAnchor:[[previewWindow
contentLayoutGuide] topAnchor] constant:0.0],
- [[contentView bottomAnchor] constraintEqualToAnchor:[bgView
bottomAnchor] constant:6.0]];
+ [[contentView bottomAnchor] constraintEqualToAnchor:[bgView
bottomAnchor] constant:PREVIEW_INSET]];
[[constraints objectAtIndex:2]
setPriority:NSLayoutPriorityDefaultHigh];
[NSLayoutConstraint activateConstraints:constraints];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit