Revision: 15689
http://sourceforge.net/p/skim-app/code/15689
Author: hofman
Date: 2025-10-08 14:03:36 +0000 (Wed, 08 Oct 2025)
Log Message:
-----------
Make initWithContentRect: and initWithView: designated initializers for
bborderless and HUD windows resp.
Modified Paths:
--------------
trunk/SKAnimatedBorderlessWindow.h
trunk/SKAnimatedBorderlessWindow.m
trunk/SKNavigationWindow.h
trunk/SKNavigationWindow.m
Modified: trunk/SKAnimatedBorderlessWindow.h
===================================================================
--- trunk/SKAnimatedBorderlessWindow.h 2025-10-08 09:43:15 UTC (rev 15688)
+++ trunk/SKAnimatedBorderlessWindow.h 2025-10-08 14:03:36 UTC (rev 15689)
@@ -45,7 +45,7 @@
NSTimeInterval autoHideTimeInterval;
}
-- (instancetype)initWithContentRect:(NSRect)contentRect;
+- (instancetype)initWithContentRect:(NSRect)contentRect
NS_DESIGNATED_INITIALIZER;
@property (nonatomic) CGFloat defaultAlphaValue;
@property (nonatomic) NSTimeInterval autoHideTimeInterval;
Modified: trunk/SKAnimatedBorderlessWindow.m
===================================================================
--- trunk/SKAnimatedBorderlessWindow.m 2025-10-08 09:43:15 UTC (rev 15688)
+++ trunk/SKAnimatedBorderlessWindow.m 2025-10-08 14:03:36 UTC (rev 15689)
@@ -52,7 +52,7 @@
@synthesize defaultAlphaValue, autoHideTimeInterval;
@dynamic fadeInDuration, fadeOutDuration;
-- (instancetype)initWithContentRect:(NSRect)contentRect
styleMask:(NSWindowStyleMask)style backing:(NSBackingStoreType)backingStoreType
defer:(BOOL)flag {
+- (instancetype)initWithContentRect:(NSRect)contentRect {
self = [super initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
defaultAlphaValue = ALPHA_VALUE;
@@ -68,8 +68,8 @@
return self;
}
-- (instancetype)initWithContentRect:(NSRect)contentRect {
- return [self initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+- (instancetype)initWithContentRect:(NSRect)contentRect
styleMask:(NSWindowStyleMask)style backing:(NSBackingStoreType)backingStoreType
defer:(BOOL)flag {
+ return [self initWithContentRect:contentRect];
}
- (void)dealloc {
Modified: trunk/SKNavigationWindow.h
===================================================================
--- trunk/SKNavigationWindow.h 2025-10-08 09:43:15 UTC (rev 15688)
+++ trunk/SKNavigationWindow.h 2025-10-08 14:03:36 UTC (rev 15689)
@@ -59,7 +59,8 @@
SKNavigationButton *closeButton;
SKNavigationToolTipWindow *toolTipWindow;
}
-- (instancetype)initWithView:(SKPresentationView *)pdfView;
+- (instancetype)initWithView:(SKPresentationView *)pdfView
NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithContentRect:(NSRect)contentRect NS_UNAVAILABLE;
- (void)handleAutoScalesChangedNotification:(NSNotification *)notification;
- (void)handlePageChangedNotification:(NSNotification *)notification;
- (SKNavigationToolTipWindow *)toolTipWindowCreating:(BOOL)create;
@@ -72,7 +73,8 @@
NSSegmentedControl *drawButton;
NSSegmentedControl *closeButton;
}
-- (instancetype)initWithView:(SKPresentationView *)pdfView;
+- (instancetype)initWithView:(SKPresentationView *)pdfView
NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithContentRect:(NSRect)contentRect NS_UNAVAILABLE;
- (void)selectCursorStyle:(NSInteger)style;
- (void)removeShadow:(BOOL)removeShadow;
@end
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2025-10-08 09:43:15 UTC (rev 15688)
+++ trunk/SKNavigationWindow.m 2025-10-08 14:03:36 UTC (rev 15689)
@@ -74,7 +74,7 @@
@implementation SKHUDWindow
- (instancetype)initWithContentRect:(NSRect)contentRect {
- self = [self initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+ self = [super initWithContentRect:contentRect];
if (self) {
[self setIgnoresMouseEvents:NO];
[self setDisplaysWhenScreenProfileChanges:YES];
@@ -144,7 +144,7 @@
NSScreen *screen = [[presentationView window] screen] ?: [NSScreen
mainScreen];
CGFloat width = 5 * BUTTON_WIDTH + 3 * SEP_WIDTH + 2 * BUTTON_MARGIN;
NSRect contentRect = NSMakeRect(NSMidX([screen frame]) - 0.5 * width,
NSMinY([screen frame]) + WINDOW_OFFSET, width, BUTTON_HEIGHT + 2 *
BUTTON_MARGIN);
- self = [self initWithContentRect:contentRect];
+ self = [super initWithContentRect:contentRect];
if (self) {
[self setLevel:[[presentationView window] level]];
@@ -256,8 +256,8 @@
- (instancetype)initWithView:(SKPresentationView *)presentationView {
NSScreen *screen = [[presentationView window] screen] ?: [NSScreen
mainScreen];
- NSRect contentRect = NSMakeRect(NSMidX([screen frame]) - 212.0,
NSMinY([screen frame]) + WINDOW_OFFSET, 424.0, 38.0);
- self = [self initWithContentRect:contentRect];
+ NSRect contentRect = NSMakeRect(NSMidX([screen frame]) - 300.0,
NSMinY([screen frame]) + WINDOW_OFFSET, 600.0, 38.0);
+ self = [super initWithContentRect:contentRect];
if (self) {
[self setLevel:[[presentationView window] level]];
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