Revision: 7489
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7489&view=rev
Author:   hofman
Date:     2011-09-14 15:17:05 +0000 (Wed, 14 Sep 2011)
Log Message:
-----------
combine methods to update utility panels

Modified Paths:
--------------
    trunk/SKMainWindowController_UI.m

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2011-09-13 10:30:10 UTC (rev 7488)
+++ trunk/SKMainWindowController_UI.m   2011-09-14 15:17:05 UTC (rev 7489)
@@ -116,25 +116,6 @@
 
 #pragma mark UI updating
 
-- (void)updateFontPanel {
-    PDFAnnotation *annotation = [pdfView activeAnnotation];
-    
-    if ([[self window] isMainWindow]) {
-        if ([annotation isSkimNote]) {
-            if ([annotation respondsToSelector:@selector(font)]) {
-                mwcFlags.updatingFont = 1;
-                [[NSFontManager sharedFontManager] 
setSelectedFont:[(PDFAnnotationFreeText *)annotation font] isMultiple:NO];
-                mwcFlags.updatingFont = 0;
-            }
-            if ([annotation respondsToSelector:@selector(fontColor)]) {
-                mwcFlags.updatingFontAttributes = 1;
-                [[NSFontManager sharedFontManager] 
setSelectedAttributes:[NSDictionary 
dictionaryWithObjectsAndKeys:[(PDFAnnotationFreeText *)annotation fontColor], 
NSForegroundColorAttributeName, nil] isMultiple:NO];
-                mwcFlags.updatingFontAttributes = 0;
-            }
-        }
-    }
-}
-
 - (void)updateColorPanel {
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     NSColor *color = nil;
@@ -204,6 +185,28 @@
     }
 }
 
+- (void)updateUtilityPanel {
+    PDFAnnotation *annotation = [pdfView activeAnnotation];
+    
+    if ([[self window] isMainWindow]) {
+        if ([annotation isSkimNote]) {
+            if ([annotation respondsToSelector:@selector(font)]) {
+                mwcFlags.updatingFont = 1;
+                [[NSFontManager sharedFontManager] 
setSelectedFont:[(PDFAnnotationFreeText *)annotation font] isMultiple:NO];
+                mwcFlags.updatingFont = 0;
+            }
+            if ([annotation respondsToSelector:@selector(fontColor)]) {
+                mwcFlags.updatingFontAttributes = 1;
+                [[NSFontManager sharedFontManager] 
setSelectedAttributes:[NSDictionary 
dictionaryWithObjectsAndKeys:[(PDFAnnotationFreeText *)annotation fontColor], 
NSForegroundColorAttributeName, nil] isMultiple:NO];
+                mwcFlags.updatingFontAttributes = 0;
+            }
+        }
+    }
+    
+    [self updateColorPanel];
+    [self updateLineInspector];
+}
+
 #pragma mark NSWindow delegate protocol
 
 - (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName {
@@ -214,11 +217,8 @@
 }
 
 - (void)windowDidBecomeMain:(NSNotification *)notification {
-    if ([[self window] isEqual:[notification object]]) {
-        [self updateFontPanel];
-        [self updateColorPanel];
-        [self updateLineInspector];
-    }
+    if ([[self window] isEqual:[notification object]])
+        [self updateUtilityPanel];
 }
 
 - (void)windowDidResignMain:(NSNotification *)notification {
@@ -1667,11 +1667,8 @@
 - (void)handleDidChangeActiveAnnotationNotification:(NSNotification 
*)notification {
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     
-    if ([[self window] isMainWindow]) {
-        [self updateFontPanel];
-        [self updateColorPanel];
-        [self updateLineInspector];
-    }
+    if ([[self window] isMainWindow])
+        [self updateUtilityPanel];
     if ([annotation isSkimNote]) {
         if ([[self selectedNotes] containsObject:annotation] == NO) {
             [rightSideController.noteOutlineView selectRowIndexes:[NSIndexSet 
indexSetWithIndex:[rightSideController.noteOutlineView rowForItem:annotation]] 
byExtendingSelection:NO];

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
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to