Quick intermediary checkin to add the preset color pull-down. More coming soon.
authorMatthew Judy <mjudy@ithinksw.com>
Thu, 20 Nov 2003 11:20:20 +0000 (11:20 +0000)
committerMatthew Judy <mjudy@ithinksw.com>
Thu, 20 Nov 2003 11:20:20 +0000 (11:20 +0000)
English.lproj/Preferences.nib/classes.nib
English.lproj/Preferences.nib/keyedobjects.nib
PreferencesController.h
PreferencesController.m
libValidate.a

index da4ec7f..3dea3b8 100755 (executable)
@@ -21,6 +21,7 @@
                 appearanceEffectPopup = NSPopUpButton; 
                 appearanceSpeedSlider = NSSlider; 
                 artistCheckbox = NSButton; 
+                backgroundColorPopup = NSPopUpButton; 
                 backgroundColorWell = NSColorWell; 
                 backgroundStylePopup = NSPopUpButton; 
                 clientPasswordTextField = NSTextField; 
index fe7a69d..19faba6 100755 (executable)
Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ
index 9e71df2..1d556dd 100755 (executable)
@@ -25,6 +25,7 @@
     IBOutlet NSButton *artistCheckbox;
     IBOutlet NSPopUpButton *backgroundStylePopup;
     IBOutlet NSColorWell *backgroundColorWell;
+    IBOutlet NSPopUpButton *backgroundColorPopup;
     IBOutlet NSTextField *clientPasswordTextField;
     IBOutlet NSTextField *hostTextField;
     IBOutlet NSTableView *hotKeysTableView;
index 39c0c9f..e7421f4 100755 (executable)
@@ -36,6 +36,7 @@
 - (void)setupCustomizationTables;
 - (void)setupMenuItems;
 - (void)setupUI;
+- (void)setCustomColor:(NSColor *)color updateWell:(BOOL)update;
 - (IBAction)changeMenus:(id)sender;
 - (void)setLaunchesAtLogin:(BOOL)flag;
 @end
@@ -434,25 +435,55 @@ static PreferencesController *prefs = nil;
         
         if ( setting == 0 ) {
             [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundApple];
-            [backgroundColorWell setEnabled:NO];
+            [backgroundColorWell  setEnabled:NO];
+            [backgroundColorPopup setEnabled:NO];
         } else if ( setting == 1 ) {
             [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundReadable];
-            [backgroundColorWell setEnabled:NO];
+            [backgroundColorWell  setEnabled:NO];
+            [backgroundColorPopup setEnabled:NO];
         } else if ( setting == 2 ) {
             [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundColored];
-            [backgroundColorWell setEnabled:YES];
+            [backgroundColorWell  setEnabled:YES];
+            [backgroundColorPopup setEnabled:YES];
         }
 
         [df setInteger:setting forKey:@"statusWindowBackgroundMode"];
         
     } else if ( [sender tag] == 2091) {
-        [(ITTSWBackgroundView *)[sw contentView] setBackgroundColor:[sender color]];
-        [df setObject:[NSArchiver archivedDataWithRootObject:[sender color]] forKey:@"statusWindowBackgroundColor"];
+        [self setCustomColor:[sender color] updateWell:NO];
+    } else if ( [sender tag] == 2092) {
+        
+        int selectedItem = [sender indexOfSelectedItem];
+        
+        if ( selectedItem == 1 ) { // An NSPopUpButton in PullDown mode uses item 0 as its title.  Its first selectable item is 1.
+            [self setCustomColor:[NSColor colorWithCalibratedRed:0.92549 green:0.686275 blue:0.0 alpha:1.0] updateWell:YES];
+        } else if ( selectedItem == 2 ) {
+            [self setCustomColor:[NSColor colorWithCalibratedRed:0.380392 green:0.670588 blue:0.0 alpha:1.0] updateWell:YES];
+        } else if ( selectedItem == 3 ) {
+            [self setCustomColor:[NSColor colorWithCalibratedRed:0.443137 green:0.231373 blue:0.619608 alpha:1.0] updateWell:YES];
+        } else if ( selectedItem == 4 ) {
+            [self setCustomColor:[NSColor colorWithCalibratedRed:0.831373 green:0.12549 blue:0.509804 alpha:1.0] updateWell:YES];
+        } else if ( selectedItem == 5 ) {
+            [self setCustomColor:[NSColor colorWithCalibratedRed:0.00784314 green:0.611765 blue:0.662745 alpha:1.0] updateWell:YES];
+        } else {
+            [self setCustomColor:[NSColor colorWithCalibratedWhite:0.15 alpha:0.70] updateWell:YES];
+        }
+
     }
     
     [df synchronize];
 }
 
+- (void)setCustomColor:(NSColor *)color updateWell:(BOOL)update
+{
+    [(ITTSWBackgroundView *)[[StatusWindow sharedWindow] contentView] setBackgroundColor:color];
+    [df setObject:[NSArchiver archivedDataWithRootObject:color] forKey:@"statusWindowBackgroundColor"];
+    
+    if ( update ) {
+        [backgroundColorWell setColor:color];
+    }
+}
+
 - (void)registerDefaults
 {
     BOOL found = NO;
@@ -757,9 +788,11 @@ static PreferencesController *prefs = nil;
     [backgroundStylePopup selectItem:[backgroundStylePopup itemAtIndex:[backgroundStylePopup indexOfItemWithTag:selectedBGStyle]]];
 
     if ( selectedBGStyle == ITTSWBackgroundColored ) {
-        [backgroundColorWell setEnabled:YES];
+        [backgroundColorWell  setEnabled:YES];
+        [backgroundColorPopup setEnabled:YES];
     } else {
-        [backgroundColorWell setEnabled:NO];
+        [backgroundColorWell  setEnabled:NO];
+        [backgroundColorPopup setEnabled:NO];
     }
 
     [backgroundColorWell setColor:(NSColor *)[NSUnarchiver unarchiveObjectWithData:[df dataForKey:@"statusWindowBackgroundColor"]]];
index d2042f6..4b1a4b8 100755 (executable)
Binary files a/libValidate.a and b/libValidate.a differ