Revision: 15331
http://sourceforge.net/p/skim-app/code/15331
Author: hofman
Date: 2025-05-30 14:17:30 +0000 (Fri, 30 May 2025)
Log Message:
-----------
intermediate window subclass to use for notes document
Modified Paths:
--------------
trunk/NotesDocument.xib
trunk/SKMainWindow.h
trunk/SKMainWindow.m
Modified: trunk/NotesDocument.xib
===================================================================
--- trunk/NotesDocument.xib 2025-05-30 13:56:30 UTC (rev 15330)
+++ trunk/NotesDocument.xib 2025-05-30 14:17:30 UTC (rev 15331)
@@ -17,7 +17,7 @@
</customObject>
<customObject id="-1" userLabel="First Responder"
customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
- <window allowsToolTipsWhenApplicationIsInactive="NO"
autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO"
visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window"
customClass="SKMainWindow">
+ <window allowsToolTipsWhenApplicationIsInactive="NO"
autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO"
visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window"
customClass="SKWindow">
<windowStyleMask key="styleMask" titled="YES" closable="YES"
miniaturizable="YES" resizable="YES"/>
<windowCollectionBehavior key="collectionBehavior"
fullScreenPrimary="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES"
rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
Modified: trunk/SKMainWindow.h
===================================================================
--- trunk/SKMainWindow.h 2025-05-30 13:56:30 UTC (rev 15330)
+++ trunk/SKMainWindow.h 2025-05-30 14:17:30 UTC (rev 15331)
@@ -46,6 +46,9 @@
SKWindowTitleHiddenForTabBar
};
+@interface SKWindow : NSWindow
+@end
+
@protocol SKMainWindowDelegate <NSWindowDelegate>
@optional
- (void)window:(NSWindow *)window willSendEvent:(NSEvent *)event;
@@ -52,7 +55,7 @@
- (void)window:(NSWindow *)window willBecomeFullScreen:(BOOL)fullScreen;
@end
-@interface SKMainWindow : NSWindow {
+@interface SKMainWindow : SKWindow {
BOOL disableConstrainedFrame;
}
Modified: trunk/SKMainWindow.m
===================================================================
--- trunk/SKMainWindow.m 2025-05-30 13:56:30 UTC (rev 15330)
+++ trunk/SKMainWindow.m 2025-05-30 14:17:30 UTC (rev 15331)
@@ -46,6 +46,28 @@
- (NSTitlebarAccessoryViewController *)_tabBarAccessoryViewController;
@end
+#pragma mark -
+
+@implementation SKWindow
+
+- (void)keyDown:(NSEvent *)event {
+ if (([event deviceIndependentModifierFlags] &
~NSEventModifierFlagNumericPad) == (NSEventModifierFlagCommand |
NSEventModifierFlagOption)) {
+ unichar eventChar = [event firstCharacter];
+ if (eventChar >= '1' && eventChar <= '9') {
+ NSArray *windows = [self tabbedWindows];
+ if ([windows count] > MAX(1UL, eventChar - '1')) {
+ [self setValue:[windows objectAtIndex:eventChar - '1']
forKeyPath:@"tabGroup.selectedWindow"];
+ return;
+ }
+ }
+ }
+ [super keyDown:event];
+}
+
+@end
+
+#pragma mark -
+
@implementation SKMainWindow
@synthesize disableConstrainedFrame, autoTitleVisibility;
@@ -91,20 +113,6 @@
[super sendEvent:theEvent];
}
-- (void)keyDown:(NSEvent *)event {
- if (([event deviceIndependentModifierFlags] &
~NSEventModifierFlagNumericPad) == (NSEventModifierFlagCommand |
NSEventModifierFlagOption)) {
- unichar eventChar = [event firstCharacter];
- if (eventChar >= '1' && eventChar <= '9') {
- NSArray *windows = [self tabbedWindows];
- if ([windows count] > MAX(1UL, eventChar - '1')) {
- [self setValue:[windows objectAtIndex:eventChar - '1']
forKeyPath:@"tabGroup.selectedWindow"];
- return;
- }
- }
- }
- [super keyDown:event];
-}
-
- (void)resignMainWindow {
[[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil];
[super resignMainWindow];
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