Permalink
Browse files

Fix for ticket #1: Full-screen display

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information...
1 parent f0d651e commit 7ba02d9c3a19e732bd4fa9c8c55e640e2e43173b Philippe Casgrain committed with Jul 12, 2009
Showing with 16 additions and 1 deletion.
  1. +1 −0 MyDocument.h
  2. +15 −1 MyDocument.m
View
@@ -8,6 +8,7 @@
IBOutlet BlitzPDFView *pdfView;
@private PDFDocument *pdfDocument;
@private NSTimer *timer;
+ @private BOOL isInFullScreenMode;
}
@property (retain, nonatomic) IBOutlet BlitzPDFView *pdfView;
View
@@ -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_];
@@ -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 {

0 comments on commit 7ba02d9

Please sign in to comment.