From: <ho...@us...> - 2009-08-16 11:34:11
|
Revision: 5561 http://skim-app.svn.sourceforge.net/skim-app/?rev=5561&view=rev Author: hofman Date: 2009-08-16 11:33:55 +0000 (Sun, 16 Aug 2009) Log Message: ----------- enum for closed full screen side panel behavior Modified Paths: -------------- trunk/SKSideWindow.m Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2009-08-16 09:51:26 UTC (rev 5560) +++ trunk/SKSideWindow.m 2009-08-16 11:33:55 UTC (rev 5561) @@ -54,21 +54,23 @@ #define SKHideClosedFullScreenSidePanelsKey @"SKHideClosedFullScreenSidePanels" +enum { SKClosedSidePanelDefault, SKClosedSidePanelAutoHide, SKClosedSidePanelHide }; + @implementation SKSideWindow -static NSUInteger hideWhenClosed = NO; +static NSUInteger hideWhenClosed = SKClosedSidePanelDefault; + (void)initialize { SKINITIALIZE; hideWhenClosed = [[NSUserDefaults standardUserDefaults] integerForKey:SKHideClosedFullScreenSidePanelsKey]; - if (hideWhenClosed == 2) + if (hideWhenClosed == SKClosedSidePanelHide) WINDOW_OFFSET = 0.0; } + (BOOL)isAutoHideEnabled { - return hideWhenClosed != 2; + return hideWhenClosed != SKClosedSidePanelHide; } - (id)initWithMainController:(SKMainWindowController *)aController edge:(NSRectEdge)anEdge { @@ -110,7 +112,7 @@ frame = NSInsetRect(frame, 0.0, WINDOW_INSET); [self setFrame:frame display:NO]; state = NSDrawerClosedState; - if (hideWhenClosed) + if (hideWhenClosed != SKClosedSidePanelDefault) [self setAlphaValue:0.0]; [[self contentView] setAcceptsMouseOver:YES]; } @@ -144,7 +146,7 @@ if ([self isKeyWindow]) [[controller window] makeKeyAndOrderFront:self]; state = NSDrawerClosedState; - if (hideWhenClosed) { + if (hideWhenClosed != SKClosedSidePanelDefault) { if ([self respondsToSelector:@selector(animator)]) [self performSelector:@selector(makeTransparent) withObject:nil afterDelay:[[NSAnimationContext currentContext] duration]]; else @@ -266,7 +268,7 @@ } - (BOOL)acceptsMouseOver { - return acceptsMouseOver && hideWhenClosed != 2; + return acceptsMouseOver && hideWhenClosed != SKClosedSidePanelHide; } - (void)setAcceptsMouseOver:(BOOL)flag { @@ -435,7 +437,7 @@ } - (void)trackMouseOvers { - if ([self window] && resizing == NO && hideWhenClosed != 2) { + if ([self window] && resizing == NO && hideWhenClosed != SKClosedSidePanelHide) { if (trackingRect) [self removeTrackingRect:trackingRect]; trackingRect = [self addTrackingRect:[self bounds] owner:self userData:NULL assumeInside:NSMouseInRect([self convertPoint:[[self window] mouseLocationOutsideOfEventStream] fromView:nil], [self bounds], [self isFlipped])]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |