Revision: 7853
http://skim-app.svn.sourceforge.net/skim-app/?rev=7853&view=rev
Author: hofman
Date: 2012-12-14 23:23:57 +0000 (Fri, 14 Dec 2012)
Log Message:
-----------
Use more generic window controller and informal category for side window
controller
Modified Paths:
--------------
trunk/SKMainWindowController.m
trunk/SKSideWindow.h
trunk/SKSideWindow.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2012-12-14 16:03:38 UTC (rev 7852)
+++ trunk/SKMainWindowController.m 2012-12-14 23:23:57 UTC (rev 7853)
@@ -1015,6 +1015,8 @@
} else if (sideWindow == rightSideWindow) {
[self toggleRightSidePane:self];
}
+ } else if ([self interactionMode] == SKPresentationMode) {
+ [self exitFullscreen:nil];
}
}
Modified: trunk/SKSideWindow.h
===================================================================
--- trunk/SKSideWindow.h 2012-12-14 16:03:38 UTC (rev 7852)
+++ trunk/SKSideWindow.h 2012-12-14 23:23:57 UTC (rev 7853)
@@ -40,10 +40,8 @@
#import "SKMainWindow.h"
-@class SKMainWindowController;
-
@interface SKSideWindow : SKMainWindow {
- SKMainWindowController *controller;
+ NSWindowController *controller;
NSDrawerState state;
NSRectEdge edge;
NSView *mainContentView;
@@ -62,7 +60,7 @@
@property (nonatomic, getter=isEnabled) BOOL enabled;
@property (nonatomic) BOOL acceptsMouseOver;
-- (id)initWithMainController:(SKMainWindowController *)aController
edge:(NSRectEdge)anEdge;
+- (id)initWithMainController:(NSWindowController *)aController
edge:(NSRectEdge)anEdge;
- (void)attachToWindow:(NSWindow *)window;
- (void)slideIn;
- (void)slideOut;
@@ -79,3 +77,8 @@
}
- (id)initWithFrame:(NSRect)frameRect edge:(NSRectEdge)anEdge;
@end
+
+
+@interface NSWindowController (SKSideWindowController)
+- (void)closeSideWindow:(SKSideWindow *)sideWindow;
+@end
Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m 2012-12-14 16:03:38 UTC (rev 7852)
+++ trunk/SKSideWindow.m 2012-12-14 23:23:57 UTC (rev 7853)
@@ -37,7 +37,6 @@
*/
#import "SKSideWindow.h"
-#import "SKMainWindowController.h"
#import "NSBezierPath_SKExtensions.h"
#import "NSEvent_SKExtensions.h"
#import "SKStringConstants.h"
@@ -77,7 +76,7 @@
return hideWhenClosed == SKClosedSidePanelHide ? 0.0 : WINDOW_OFFSET + 1.0;
}
-- (id)initWithMainController:(SKMainWindowController *)aController
edge:(NSRectEdge)anEdge {
+- (id)initWithMainController:(NSWindowController *)aController
edge:(NSRectEdge)anEdge {
NSScreen *screen = [[aController window] screen] ?: [NSScreen mainScreen];
NSRect contentRect = NSInsetRect(SKSliceRect([screen frame],
DEFAULT_WINDOW_WIDTH, anEdge), 0.0, WINDOW_INSET);
@@ -228,17 +227,15 @@
}
- (void)keyDown:(NSEvent *)theEvent {
- if ([theEvent firstCharacter] == 'p' && [theEvent
deviceIndependentModifierFlags] == 0 && [controller interactionMode] ==
SKPresentationMode)
+ if ([theEvent firstCharacter] == 'p' && [theEvent
deviceIndependentModifierFlags] == 0 && enabled == NO && [controller
respondsToSelector:@selector(closeSideWindow:)])
[controller closeSideWindow:self];
else
[super keyDown:theEvent];
}
- (void)cancelOperation:(id)sender {
- if (state == NSDrawerOpenState || state == NSDrawerOpeningState)
+ if ([controller respondsToSelector:@selector(closeSideWindow:)])
[controller closeSideWindow:self];
- else
- [controller exitFullscreen:self];
}
- (NSResponder *)nextResponder {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit