Revision: 5520
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5520&view=rev
Author:   hofman
Date:     2009-08-07 10:04:16 +0000 (Fri, 07 Aug 2009)

Log Message:
-----------
make hidden pref to hide the side windows an enum, use 2 to disable the 
auto-hide feature an only show/hide manually

Modified Paths:
--------------
    trunk/SKMainWindowController.m
    trunk/SKSideWindow.h
    trunk/SKSideWindow.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2009-08-03 19:12:09 UTC (rev 5519)
+++ trunk/SKMainWindowController.m      2009-08-07 10:04:16 UTC (rev 5520)
@@ -1354,7 +1354,8 @@
     [self showLeftSideWindowOnScreen:screen];
     [self showRightSideWindowOnScreen:screen];
     
-    [pdfSplitView setFrame:NSInsetRect([[pdfSplitView superview] bounds], 9.0, 
0.0)];
+    if ([SKSideWindow isAutoHideEnabled])
+        [pdfSplitView setFrame:NSInsetRect([[pdfSplitView superview] bounds], 
9.0, 0.0)];
     [[pdfSplitView superview] setNeedsDisplay:YES];
 }
 

Modified: trunk/SKSideWindow.h
===================================================================
--- trunk/SKSideWindow.h        2009-08-03 19:12:09 UTC (rev 5519)
+++ trunk/SKSideWindow.h        2009-08-07 10:04:16 UTC (rev 5520)
@@ -48,6 +48,8 @@
     NSRectEdge edge;
 }
 
++ (BOOL)isAutoHideEnabled;
+
 - (id)initWithMainController:(SKMainWindowController *)aController 
edge:(NSRectEdge)anEdge;
 - (void)moveToScreen:(NSScreen *)screen;
 - (void)slideIn;

Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m        2009-08-03 19:12:09 UTC (rev 5519)
+++ trunk/SKSideWindow.m        2009-08-07 10:04:16 UTC (rev 5520)
@@ -44,25 +44,33 @@
 
 #define DEFAULT_WINDOW_WIDTH    300.0
 #define WINDOW_INSET            1.0
-#define WINDOW_OFFSET           8.0
 #define CORNER_RADIUS           8.0
 #define CONTENT_INSET           8.0
 #define WINDOW_MIN_WIDTH        14.0
 #define RESIZE_HANDLE_WIDTH     8.0
 #define RESIZE_HANDLE_HEIGHT    20.0
 
+static CGFloat WINDOW_OFFSET = 8.0;
+
 #define SKHideClosedFullScreenSidePanelsKey @"SKHideClosedFullScreenSidePanels"
 
 @implementation SKSideWindow
 
-static BOOL hideWhenClosed = NO;
+static NSUInteger hideWhenClosed = NO;
 
 + (void)initialize {
     SKINITIALIZE;
     
-    hideWhenClosed = [[NSUserDefaults standardUserDefaults] 
boolForKey:SKHideClosedFullScreenSidePanelsKey];
+    hideWhenClosed = [[NSUserDefaults standardUserDefaults] 
integerForKey:SKHideClosedFullScreenSidePanelsKey];
+    
+    if (hideWhenClosed == 2)
+        WINDOW_OFFSET = 0.0;
 }
 
++ (BOOL)isAutoHideEnabled {
+    return hideWhenClosed != 2;
+}
+
 - (id)initWithMainController:(SKMainWindowController *)aController 
edge:(NSRectEdge)anEdge {
     NSScreen *screen = [[aController window] screen] ?: [NSScreen mainScreen];
     NSRect contentRect = [screen frame];
@@ -258,7 +266,7 @@
 }
 
 - (BOOL)acceptsMouseOver {
-    return acceptsMouseOver;
+    return acceptsMouseOver && hideWhenClosed != 2;
 }
 
 - (void)setAcceptsMouseOver:(BOOL)flag {
@@ -427,7 +435,7 @@
 }
 
 - (void)trackMouseOvers {
-    if ([self window] && resizing == NO) {
+    if ([self window] && resizing == NO && hideWhenClosed != 2) {
         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.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to