Revision: 15688
http://sourceforge.net/p/skim-app/code/15688
Author: hofman
Date: 2025-10-08 09:43:15 +0000 (Wed, 08 Oct 2025)
Log Message:
-----------
Default initialization in designated initializer of window, as we cannot call
super in convenience initializers.
Modified Paths:
--------------
trunk/SKAnimatedBorderlessWindow.m
trunk/SKApplicationController.m
trunk/SKNavigationWindow.h
trunk/SKNavigationWindow.m
Modified: trunk/SKAnimatedBorderlessWindow.m
===================================================================
--- trunk/SKAnimatedBorderlessWindow.m 2025-10-07 15:56:59 UTC (rev 15687)
+++ trunk/SKAnimatedBorderlessWindow.m 2025-10-08 09:43:15 UTC (rev 15688)
@@ -52,15 +52,14 @@
@synthesize defaultAlphaValue, autoHideTimeInterval;
@dynamic fadeInDuration, fadeOutDuration;
-- (instancetype)initWithContentRect:(NSRect)contentRect {
- self = [self initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+- (instancetype)initWithContentRect:(NSRect)contentRect
styleMask:(NSWindowStyleMask)style backing:(NSBackingStoreType)backingStoreType
defer:(BOOL)flag {
+ self = [super initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
defaultAlphaValue = ALPHA_VALUE;
autoHideTimeInterval = AUTO_HIDE_TIME_INTERVAL;
-
+ [self setAlphaValue:[self defaultAlphaValue]];
[self setBackgroundColor:[NSColor clearColor]];
- [self setOpaque:NO];
- [self setAlphaValue:[self defaultAlphaValue]];
+ [self setOpaque:NO];
[self setReleasedWhenClosed:NO];
[self setHidesOnDeactivate:NO];
[self setAnimationBehavior:NSWindowAnimationBehaviorNone];
@@ -69,6 +68,10 @@
return self;
}
+- (instancetype)initWithContentRect:(NSRect)contentRect {
+ return [self initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+}
+
- (void)dealloc {
[self stopAnimation];
}
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2025-10-07 15:56:59 UTC (rev 15687)
+++ trunk/SKApplicationController.m 2025-10-08 09:43:15 UTC (rev 15688)
@@ -222,6 +222,7 @@
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification{
+ NSLog(@"%@", [[NSFileManager defaultManager]
uniqueChewableItemsDirectoryURL]);
NSUserDefaults *sud = [NSUserDefaults standardUserDefaults];
if (didReopen == NO && [sud integerForKey:SKReopenLastOpenFilesKey] ==
SKReopenOnDefaultLaunch && [[[aNotification userInfo]
objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue])
Modified: trunk/SKNavigationWindow.h
===================================================================
--- trunk/SKNavigationWindow.h 2025-10-07 15:56:59 UTC (rev 15687)
+++ trunk/SKNavigationWindow.h 2025-10-08 09:43:15 UTC (rev 15688)
@@ -44,7 +44,6 @@
@class SKPresentationView, SKNavigationToolTipView, SKNavigationButton;
@interface SKHUDWindow : SKAnimatedBorderlessWindow
-- (instancetype)initWithView:(SKPresentationView *)pdfView;
- (void)showForWindow:(NSWindow *)window;
- (void)handleParentWindowDidResizeNotification:(NSNotification *)notification;
@end
@@ -60,6 +59,7 @@
SKNavigationButton *closeButton;
SKNavigationToolTipWindow *toolTipWindow;
}
+- (instancetype)initWithView:(SKPresentationView *)pdfView;
- (void)handleAutoScalesChangedNotification:(NSNotification *)notification;
- (void)handlePageChangedNotification:(NSNotification *)notification;
- (SKNavigationToolTipWindow *)toolTipWindowCreating:(BOOL)create;
@@ -72,6 +72,7 @@
NSSegmentedControl *drawButton;
NSSegmentedControl *closeButton;
}
+- (instancetype)initWithView:(SKPresentationView *)pdfView;
- (void)selectCursorStyle:(NSInteger)style;
- (void)removeShadow:(BOOL)removeShadow;
@end
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2025-10-07 15:56:59 UTC (rev 15687)
+++ trunk/SKNavigationWindow.m 2025-10-08 09:43:15 UTC (rev 15688)
@@ -73,16 +73,11 @@
@implementation SKHUDWindow
-- (instancetype)initWithView:(SKPresentationView *)presentationView {
- 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];
+- (instancetype)initWithContentRect:(NSRect)contentRect {
+ self = [self initWithContentRect:contentRect
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
-
[self setIgnoresMouseEvents:NO];
[self setDisplaysWhenScreenProfileChanges:YES];
- [self setLevel:[[presentationView window] level]];
[self setMovableByWindowBackground:YES];
contentRect.origin = NSZeroPoint;
@@ -97,7 +92,6 @@
if (@available(macOS 10.14, *))
[self setAppearance:[NSAppearance
appearanceNamed:NSAppearanceNameDarkAqua]];
-
}
return self;
}
@@ -147,8 +141,12 @@
@implementation SKNavigationWindow
- (instancetype)initWithView:(SKPresentationView *)presentationView {
- self = [super initWithView:presentationView];
+ 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];
if (self) {
+ [self setLevel:[[presentationView window] level]];
NSRect rect = NSMakeRect(BUTTON_MARGIN, BUTTON_MARGIN, BUTTON_WIDTH,
BUTTON_HEIGHT);
previousButton = [[SKNavigationButton alloc] initWithFrame:rect];
@@ -257,8 +255,11 @@
@implementation SKCursorStyleWindow
- (instancetype)initWithView:(SKPresentationView *)presentationView {
- self = [super initWithView: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];
if (self) {
+ [self setLevel:[[presentationView window] level]];
NSRect rect;
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