Revision: 6355
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6355&view=rev
Author:   hofman
Date:     2010-03-21 22:05:14 +0000 (Sun, 21 Mar 2010)

Log Message:
-----------
implement font changing actions in pref panel

Modified Paths:
--------------
    trunk/NSView_SKExtensions.h
    trunk/NSView_SKExtensions.m
    trunk/SKNotesPreferences.h
    trunk/SKNotesPreferences.m
    trunk/SKPreferenceController.m

Modified: trunk/NSView_SKExtensions.h
===================================================================
--- trunk/NSView_SKExtensions.h 2010-03-21 17:59:51 UTC (rev 6354)
+++ trunk/NSView_SKExtensions.h 2010-03-21 22:05:14 UTC (rev 6355)
@@ -50,6 +50,4 @@
 
 - (void)deactivateWellSubcontrols;
 
-- (id)activeFontWellSubview;
-
 @end

Modified: trunk/NSView_SKExtensions.m
===================================================================
--- trunk/NSView_SKExtensions.m 2010-03-21 17:59:51 UTC (rev 6354)
+++ trunk/NSView_SKExtensions.m 2010-03-21 22:05:14 UTC (rev 6355)
@@ -92,16 +92,6 @@
     [[self subviews] makeObjectsPerformSelector:_cmd];
 }
 
-- (id)activeFontWellSubview {
-       NSView *view;
-       
-       for (NSView *subview in [self subviews]) {
-               if (view = [subview activeFontWellSubview])
-                       return view;
-       }
-       return nil;
-}
-
 @end
 
 
@@ -141,8 +131,4 @@
     [super deactivateWellSubcontrols];
 }
 
-- (id)activeFontWellSubview {
-    return [self isActive] ? self : [super activeFontWellSubview];
-}
-
 @end

Modified: trunk/SKNotesPreferences.h
===================================================================
--- trunk/SKNotesPreferences.h  2010-03-21 17:59:51 UTC (rev 6354)
+++ trunk/SKNotesPreferences.h  2010-03-21 22:05:14 UTC (rev 6355)
@@ -56,4 +56,7 @@
     IBOutlet NSArray *lineWells2;
 }
 
+- (IBAction)changeFont:(id)sender;
+- (IBAction)changeAttributes:(id)sender;
+
 @end

Modified: trunk/SKNotesPreferences.m
===================================================================
--- trunk/SKNotesPreferences.m  2010-03-21 17:59:51 UTC (rev 6354)
+++ trunk/SKNotesPreferences.m  2010-03-21 22:05:14 UTC (rev 6355)
@@ -127,4 +127,20 @@
 
 - (NSImage *)icon { return [NSImage imageNamed:@"NotesPreferences"]; }
 
+#pragma mark Actions
+
+- (SKFontWell *)activeFontWell {
+    for (SKFontWell *fontWell in fontWells)
+        if ([fontWell isActive]) return fontWell;
+    return nil;
+}
+
+- (IBAction)changeFont:(id)sender {
+    [[self activeFontWell] changeFontFromFontManager:sender];
+}
+
+- (IBAction)changeAttributes:(id)sender {
+    [[self activeFontWell] changeAttributesFromFontManager:sender];
+}
+
 @end

Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m      2010-03-21 17:59:51 UTC (rev 6354)
+++ trunk/SKPreferenceController.m      2010-03-21 22:05:14 UTC (rev 6355)
@@ -170,11 +170,13 @@
 }
 
 - (IBAction)changeFont:(id)sender {
-    [[[[self window] contentView] activeFontWellSubview] 
changeFontFromFontManager:sender];
+    if ([currentPane respondsToSelector:_cmd])
+        [currentPane changeFont:sender];
 }
 
 - (IBAction)changeAttributes:(id)sender {
-    [[[[self window] contentView] activeFontWellSubview] 
changeAttributesFromFontManager:sender];
+    if ([currentPane respondsToSelector:_cmd])
+        [(id)currentPane changeAttributes:sender];
 }
 
 #pragma mark Toolbar


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to