Revision: 7416
http://skim-app.svn.sourceforge.net/skim-app/?rev=7416&view=rev
Author: hofman
Date: 2011-08-04 17:19:29 +0000 (Thu, 04 Aug 2011)
Log Message:
-----------
use default background color for snapshots
Modified Paths:
--------------
trunk/SKSnapshotWindowController.m
Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m 2011-08-02 00:15:48 UTC (rev 7415)
+++ trunk/SKSnapshotWindowController.m 2011-08-04 17:19:29 UTC (rev 7416)
@@ -52,6 +52,7 @@
#import "SKSnapshotPageCell.h"
#import "PDFAnnotation_SKExtensions.h"
#import "PDFView_SKExtensions.h"
+#import "NSUserDefaults_SKExtensions.h"
#define EM_DASH_CHARACTER 0x2014
@@ -103,7 +104,7 @@
BOOL keepOnTop = [[NSUserDefaults standardUserDefaults]
boolForKey:SKSnapshotsOnTopKey];
[[self window] setLevel:keepOnTop || forceOnTop ? NSFloatingWindowLevel :
NSNormalWindowLevel];
[[self window] setHidesOnDeactivate:keepOnTop || forceOnTop];
- [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
forKeys:[NSArray arrayWithObjects:SKSnapshotsOnTopKey, SKShouldAntiAliasKey,
SKGreekingThresholdKey, SKPageBackgroundColorKey, nil]
context:&SKSnaphotWindowDefaultsObservationContext];
+ [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
forKeys:[NSArray arrayWithObjects:SKSnapshotsOnTopKey, SKShouldAntiAliasKey,
SKGreekingThresholdKey, SKBackgroundColorKey, SKPageBackgroundColorKey, nil]
context:&SKSnaphotWindowDefaultsObservationContext];
// the window is initialially exposed. The windowDidExpose notification is
useless, it has nothing to do with showing the window
[self setHasWindow:YES];
}
@@ -173,7 +174,7 @@
}
- (void)windowWillClose:(NSNotification *)notification {
- @try { [[NSUserDefaultsController sharedUserDefaultsController]
removeObserver:self forKeys:[NSArray arrayWithObjects:SKSnapshotsOnTopKey,
SKShouldAntiAliasKey, SKGreekingThresholdKey, SKPageBackgroundColorKey, nil]]; }
+ @try { [[NSUserDefaultsController sharedUserDefaultsController]
removeObserver:self forKeys:[NSArray arrayWithObjects:SKSnapshotsOnTopKey,
SKShouldAntiAliasKey, SKGreekingThresholdKey, SKBackgroundColorKey,
SKPageBackgroundColorKey, nil]]; }
@catch (id e) {}
if ([[self delegate]
respondsToSelector:@selector(snapshotControllerWillClose:)])
[[self delegate] snapshotControllerWillClose:self];
@@ -228,6 +229,7 @@
[pdfView setDisplayBox:kPDFDisplayBoxCropBox];
[pdfView setShouldAntiAlias:[[NSUserDefaults standardUserDefaults]
floatForKey:SKShouldAntiAliasKey]];
[pdfView setGreekingThreshold:[[NSUserDefaults standardUserDefaults]
floatForKey:SKGreekingThresholdKey]];
+ [pdfView setBackgroundColor:[[NSUserDefaults standardUserDefaults]
colorForKey:SKBackgroundColorKey]];
[pdfView setDocument:pdfDocument];
PDFPage *page = [pdfDocument pageAtIndex:pageNum];
@@ -526,6 +528,8 @@
[pdfView setShouldAntiAlias:[[NSUserDefaults standardUserDefaults]
boolForKey:SKShouldAntiAliasKey]];
} else if ([key isEqualToString:SKGreekingThresholdKey]) {
[pdfView setGreekingThreshold:[[NSUserDefaults
standardUserDefaults] floatForKey:SKGreekingThresholdKey]];
+ } else if ([key isEqualToString:SKBackgroundColorKey]) {
+ [pdfView setBackgroundColor:[[NSUserDefaults standardUserDefaults]
colorForKey:SKBackgroundColorKey]];
} else if ([key isEqualToString:SKPageBackgroundColorKey]) {
[pdfView setNeedsDisplay:YES];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit