Skip to content

Commit

Permalink
Fix for ticket rentzsch#1: Full-screen display
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Casgrain committed Jul 12, 2009
1 parent fb2f4bf commit 1f9ef72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions MyDocument.h
Expand Up @@ -8,6 +8,7 @@
IBOutlet BlitzPDFView *pdfView;
@private PDFDocument *pdfDocument;
@private NSTimer *timer;
@private BOOL isInFullScreenMode;
}

@property (retain, nonatomic) IBOutlet BlitzPDFView *pdfView;
Expand Down
16 changes: 15 additions & 1 deletion MyDocument.m
Expand Up @@ -4,10 +4,22 @@
@interface MyDocument ()
@property (retain, nonatomic) PDFDocument *pdfDocument;
@property (retain, nonatomic) NSTimer *timer;
@property (nonatomic) BOOL isInFullScreenMode;
@end

@implementation MyDocument
@synthesize pdfDocument, pdfView, timer;
@synthesize pdfView, pdfDocument, timer, isInFullScreenMode;

- (void)toggleFullScreenMode {
if (self.isInFullScreenMode) {
[self.pdfView exitFullScreenModeWithOptions: nil];
self.isInFullScreenMode = NO;
}
else {
NSWindow *window = [[[self windowControllers] objectAtIndex:0 ] window];
self.isInFullScreenMode = [self.pdfView enterFullScreenMode: window.screen withOptions: nil];
}
}

- (void)windowControllerDidLoadNib:(NSWindowController*)controller_ {
[super windowControllerDidLoadNib:controller_];
Expand All @@ -23,6 +35,8 @@ - (void)windowControllerDidLoadNib:(NSWindowController*)controller_ {
selector:@selector(updateElapsedTimer:)
userInfo:nil
repeats:YES] retain];
self.isInFullScreenMode = NO;
[self toggleFullScreenMode];
}

- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError {
Expand Down

0 comments on commit 1f9ef72

Please sign in to comment.