From: Matthew Judy Date: Thu, 20 Nov 2003 05:07:30 +0000 (+0000) Subject: Project fixes so that stuff builds, updates to the Background view, tweaks all over. X-Git-Tag: v0.1~9 X-Git-Url: http://git.ithinksw.org/ITKit.git/commitdiff_plain/fc20fb5991f57d35d0483a29d8a4c8f7775e7969 Project fixes so that stuff builds, updates to the Background view, tweaks all over. --- diff --git a/ITKit.xcode/project.pbxproj b/ITKit.xcode/project.pbxproj index 0894e68..a1a36f3 100755 --- a/ITKit.xcode/project.pbxproj +++ b/ITKit.xcode/project.pbxproj @@ -77,8 +77,8 @@ productRefGroup = 034768DFFF38A50411DB9C8B; projectDirPath = ""; targets = ( - 8DC2EF4F0486A6940098B216, 7C992F86054F5389000B93EA, + 8DC2EF4F0486A6940098B216, ); }; 0867D691FE84028FC02AAC07 = { @@ -131,9 +131,9 @@ 8DC2EF5A0486A6940098B216, 089C1666FE841158C02AAC07, 2A30D8BC056B3C5D0087AE54, - 2A30D89A056B3B5C0087AE54, - 7C992E3E054F5246000B93EA, 2A30D899056B3B390087AE54, + 7C992E3E054F5246000B93EA, + 2A30D89A056B3B5C0087AE54, ); isa = PBXGroup; name = Resources; @@ -164,18 +164,9 @@ 7C992F96054F53F7000B93EA, 7C992F9B054F547C000B93EA, 7C993057054F6832000B93EA, - 7C992DC9054F5179000B93EA, - 7C992DCA054F5179000B93EA, - 7C992DD8054F5179000B93EA, - 7C992DD9054F5179000B93EA, + 2AAF7B22056C3536009B9225, 7C992DED054F5179000B93EA, 7C992DEE054F5179000B93EA, - 7C992DEF054F5179000B93EA, - 7C992DF0054F5179000B93EA, - 7C992DF1054F5179000B93EA, - 7C992DF2054F5179000B93EA, - 7C992DF3054F5179000B93EA, - 7C992DF4054F5179000B93EA, ); isa = PBXGroup; name = Classes; @@ -290,7 +281,7 @@ 2A30D8A1056B3BE30087AE54, ); isa = PBXGroup; - name = HotKeys; + name = "Hot Keys"; refType = 4; sourceTree = ""; }; @@ -407,6 +398,40 @@ refType = 4; sourceTree = ""; }; + 2AAF7B22056C3536009B9225 = { + children = ( + 7C992DC9054F5179000B93EA, + 7C992DCA054F5179000B93EA, + 7C992DEF054F5179000B93EA, + 7C992DF0054F5179000B93EA, + 7C992DF1054F5179000B93EA, + 7C992DF2054F5179000B93EA, + 7C992DF3054F5179000B93EA, + 7C992DF4054F5179000B93EA, + ); + isa = PBXGroup; + name = Views; + refType = 4; + sourceTree = ""; + }; + 2AC82794056C3AA000A7D7E2 = { + fileRef = 1058C7B1FEA5585E11CA2CBB; + isa = PBXBuildFile; + settings = { + }; + }; + 2AC8297F056C451900A7D7E2 = { + containerPortal = 0867D690FE84028FC02AAC07; + isa = PBXContainerItemProxy; + proxyType = 1; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = ITKit; + }; + 2AC82980056C451900A7D7E2 = { + isa = PBXTargetDependency; + target = 8DC2EF4F0486A6940098B216; + targetProxy = 2AC8297F056C451900A7D7E2; + }; //2A0 //2A1 //2A2 @@ -1317,6 +1342,7 @@ buildActionMask = 2147483647; files = ( 7C5B7C93054F6EC9008379B6, + 2AC82794056C3AA000A7D7E2, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -1331,8 +1357,8 @@ buildRules = ( ); buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = ""; GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; INFOPLIST_FILE = "ITKitShowcase-Info.plist"; @@ -1346,6 +1372,7 @@ WARNING_CFLAGS = "-Wmost"; }; dependencies = ( + 2AC82980056C451900A7D7E2, ); isa = PBXNativeTarget; name = ITKitShowcase; @@ -1588,8 +1615,8 @@ children = ( 7C992DF9054F5179000B93EA, 7C992DFA054F5179000B93EA, - 7C992DFB054F5179000B93EA, - 7C992DFC054F5179000B93EA, + 7C992DD8054F5179000B93EA, + 7C992DD9054F5179000B93EA, 7C99305B054F687D000B93EA, ); isa = PBXGroup; @@ -1599,6 +1626,8 @@ }; 7C99305B054F687D000B93EA = { children = ( + 7C992DFB054F5179000B93EA, + 7C992DFC054F5179000B93EA, 7C992DD4054F5179000B93EA, 7C992DD5054F5179000B93EA, 7C992DD6054F5179000B93EA, diff --git a/ITTSWBackgroundView.h b/ITTSWBackgroundView.h index ff56e90..7c80758 100755 --- a/ITTSWBackgroundView.h +++ b/ITTSWBackgroundView.h @@ -14,8 +14,23 @@ #import +typedef enum _ITTSWBackgroundMode { + ITTSWBackgroundApple, + ITTSWBackgroundReadable, + ITTSWBackgroundColored +} ITTSWBackgroundMode; + + @interface ITTSWBackgroundView : NSView { - NSBezierPath *_path; + NSBezierPath *_path; + NSColor *_color; + ITTSWBackgroundMode _mode; } +- (ITTSWBackgroundMode)backgroundMode; +- (void)setBackgroundMode:(ITTSWBackgroundMode)newMode; + +- (NSColor *)backgroundColor; +- (void)setBackgroundColor:(NSColor *)newColor; + @end diff --git a/ITTSWBackgroundView.m b/ITTSWBackgroundView.m index b46328f..9ee7e7b 100755 --- a/ITTSWBackgroundView.m +++ b/ITTSWBackgroundView.m @@ -1,35 +1,47 @@ #import "ITTSWBackgroundView.h" +#define RADIUS 24.0 + + +@interface ITTSWBackgroundView (Private) +@end + + @implementation ITTSWBackgroundView + - (id)initWithFrame:(NSRect)frameRect { if ( (self = [super initWithFrame:frameRect]) ) { - _path = [[NSBezierPath bezierPath] retain]; + _path = [[NSBezierPath bezierPath] retain]; + _color = [[NSColor blueColor] retain]; + _mode = ITTSWBackgroundApple; } return self; } -- (void)drawRect:(NSRect)theRect +- (void)drawRect:(NSRect)rect { - float vh = NSHeight(theRect); - float vw = NSWidth(theRect); + float vh = NSHeight(rect); + float vw = NSWidth(rect); + float indent = 0.0; + + if ( (_mode == ITTSWBackgroundReadable) || (_mode == ITTSWBackgroundColored) ) { + indent = 2.0; + } + + NSPoint pointA = NSMakePoint( ((vw - RADIUS) - indent) , (vh - indent) ); + NSPoint pointB = NSMakePoint( (RADIUS + indent) , (vh - indent) ); + NSPoint pointD = NSMakePoint( indent , (RADIUS + indent) ); + NSPoint pointF = NSMakePoint( ((vw - RADIUS) - indent) , indent ); + NSPoint pointH = NSMakePoint( (vw - indent) , ((vh - RADIUS) - indent) ); - NSPoint pointA = NSMakePoint( 24.0 , 0.0 ); -// NSPoint pointB = NSMakePoint( 0.0 , 24.0 ); reference - NSPoint pointC = NSMakePoint( 0.0 , (vh - 24.0) ); -// NSPoint pointD = NSMakePoint( 24.0 , vh ); reference - NSPoint pointE = NSMakePoint( (vw - 24.0) , vh ); -// NSPoint pointF = NSMakePoint( vw , (vh - 24.0) ); reference - NSPoint pointG = NSMakePoint( vw , 24.0 ); -// NSPoint pointH = NSMakePoint( (vw - 24.0) , 0.0 ); reference - - NSPoint ctrAB = NSMakePoint( 24.0 , 24.0 ); - NSPoint ctrCD = NSMakePoint( 24.0 , (vh - 24.0) ); - NSPoint ctrEF = NSMakePoint( (vw - 24.0) , (vh - 24.0) ); - NSPoint ctrGH = NSMakePoint( (vw - 24.0) , 24.0 ); + NSPoint ctrBC = NSMakePoint( (RADIUS + indent) , ((vh - RADIUS) - indent) ); + NSPoint ctrDE = NSMakePoint( (RADIUS + indent) , (RADIUS + indent) ); + NSPoint ctrFG = NSMakePoint( ((vw - RADIUS) - indent) , (RADIUS + indent) ); + NSPoint ctrHA = NSMakePoint( ((vw - RADIUS) - indent) , ((vh - RADIUS) - indent) ); /* * D E @@ -41,33 +53,45 @@ * A H */ - [_path autorelease]; - _path = [[NSBezierPath bezierPath] retain]; - + [_path removeAllPoints]; + [_path moveToPoint:pointA]; // first point - [_path appendBezierPathWithArcWithCenter:ctrAB // bottom-left curve - radius:24.0 + [_path lineToPoint:pointB]; // top line + [_path appendBezierPathWithArcWithCenter:ctrBC // top-left curve + radius:RADIUS startAngle:90.0 endAngle:180.0]; - [_path lineToPoint:pointC]; // left line - [_path appendBezierPathWithArcWithCenter:ctrCD // top-left curve - radius:24.0 + [_path lineToPoint:pointD]; // left line + [_path appendBezierPathWithArcWithCenter:ctrDE // bottom-left curve + radius:RADIUS startAngle:180.0 endAngle:270.0]; - [_path lineToPoint:pointE]; // top line - [_path appendBezierPathWithArcWithCenter:ctrEF // top-right curve - radius:24.0 + [_path lineToPoint:pointF]; // top line + [_path appendBezierPathWithArcWithCenter:ctrFG // top-right curve + radius:RADIUS startAngle:270.0 endAngle:0.0]; - [_path lineToPoint:pointG]; // right line - [_path appendBezierPathWithArcWithCenter:ctrGH // bottom-right curve - radius:24.0 + [_path lineToPoint:pointH]; // right line + [_path appendBezierPathWithArcWithCenter:ctrHA // bottom-right curve + radius:RADIUS startAngle:0.0 endAngle:90.0]; - [_path lineToPoint:pointA]; // right line + + if ( _mode == ITTSWBackgroundApple ) { + [[NSColor colorWithCalibratedWhite:0.0 alpha:0.15] set]; + } else if ( _mode == ITTSWBackgroundReadable ) { + [[NSColor colorWithCalibratedWhite:0.15 alpha:0.70] set]; + } else if ( _mode == ITTSWBackgroundColored ) { + [_color set]; + } - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.15] set]; [_path fill]; + + if ( (_mode == ITTSWBackgroundReadable) || (_mode == ITTSWBackgroundColored) ) { + [[NSColor colorWithCalibratedWhite:0.90 alpha:1.00] set]; + [_path setLineWidth:3.0]; + [_path stroke]; + } } - (BOOL)isOpaque @@ -75,4 +99,28 @@ return NO; } +- (ITTSWBackgroundMode)backgroundMode +{ + return _mode; +} + +- (void)setBackgroundMode:(ITTSWBackgroundMode)newMode +{ + _mode = newMode; + [self setNeedsDisplay:YES]; +} + +- (NSColor *)backgroundColor +{ + return _color; +} + +- (void)setBackgroundColor:(NSColor *)newColor +{ + [_color autorelease]; + _color = [newColor copy]; + [self setNeedsDisplay:YES]; +} + + @end diff --git a/ITTextFieldCell.m b/ITTextFieldCell.m index 7e289fd..aed1f00 100755 --- a/ITTextFieldCell.m +++ b/ITTextFieldCell.m @@ -24,7 +24,7 @@ shadowAmbient = 0.15; shadowHeight = 1.00; shadowRadius = 4.00; - shadowSaturation = 1.2; + shadowSaturation = 1.0; } return self; diff --git a/Showcase/Controller.h b/Showcase/Controller.h index 82a1a6a..dfb9836 100755 --- a/Showcase/Controller.h +++ b/Showcase/Controller.h @@ -33,7 +33,8 @@ IBOutlet NSPopUpButton *swDefinedPositionPopup; IBOutlet NSTextField *swVanishDelay; IBOutlet NSTextField *swShadowSaturation; - IBOutlet NSSlider *swSpeedSlider; + IBOutlet NSSlider *swEntrySpeedSlider; + IBOutlet NSSlider *swExitSpeedSlider; } // ITStatusItem Support diff --git a/Showcase/Controller.m b/Showcase/Controller.m index df393b0..8455cb2 100755 --- a/Showcase/Controller.m +++ b/Showcase/Controller.m @@ -1,5 +1,6 @@ #import "Controller.h" #import "ITTransientStatusWindow.h" +#import "ITTSWBackgroundView.h" #import "ITTextField.h" #import "ITBevelView.h" #import "ITCutWindowEffect.h" @@ -38,10 +39,10 @@ statusWindow = [ITTransientStatusWindow sharedWindow]; [statusWindow setEntryEffect:[[ITCutWindowEffect alloc] initWithWindow:statusWindow]]; [statusWindow setExitEffect:[[ITDissolveWindowEffect alloc] initWithWindow:statusWindow]]; - [[statusWindow entryEffect] setEffectTime:[swSpeedSlider floatValue]]; - [[statusWindow exitEffect] setEffectTime:[swSpeedSlider floatValue]]; + [[statusWindow entryEffect] setEffectTime:[swEntrySpeedSlider floatValue]]; + [[statusWindow exitEffect] setEffectTime:[swExitSpeedSlider floatValue]]; // [tabView setAllowsDragging:YES]; - + [[NSColorPanel sharedColorPanel] setShowsAlpha:YES]; } /*************************************************************************/ @@ -218,7 +219,6 @@ [textField setTextColor:[NSColor whiteColor]]; [textField setCastsShadow:YES]; [textField setStringValue:text]; - [textField setShadowSaturation:[swShadowSaturation floatValue]]; [[statusWindow contentView] addSubview:textField]; [[statusWindow contentView] setNeedsDisplay:YES]; @@ -255,6 +255,7 @@ [statusWindow setHorizontalPosition:[sender indexOfSelectedItem]]; } else if ( [sender tag] == 3060 ) { [[statusWindow entryEffect] setEffectTime:[sender floatValue]]; + } else if ( [sender tag] == 3061 ) { [[statusWindow exitEffect] setEffectTime:[sender floatValue]]; } else if ( [sender tag] == 3070 ) { @@ -270,7 +271,7 @@ [statusWindow setEntryEffect:[[[ITPivotWindowEffect alloc] initWithWindow:statusWindow] autorelease]]; } - [[statusWindow entryEffect] setEffectTime:[swSpeedSlider floatValue]]; + [[statusWindow entryEffect] setEffectTime:[swEntrySpeedSlider floatValue]]; } else if ( [sender tag] == 3080 ) { @@ -286,8 +287,20 @@ [statusWindow setExitEffect:[[ITPivotWindowEffect alloc] initWithWindow:statusWindow]]; } - [[statusWindow exitEffect] setEffectTime:[swSpeedSlider floatValue]]; + [[statusWindow exitEffect] setEffectTime:[swExitSpeedSlider floatValue]]; + } else if ( [sender tag] == 3090 ) { + + if ( [sender indexOfSelectedItem] == 0 ) { + [(ITTSWBackgroundView *)[statusWindow contentView] setBackgroundMode:ITTSWBackgroundApple]; + } else if ( [sender indexOfSelectedItem] == 1 ) { + [(ITTSWBackgroundView *)[statusWindow contentView] setBackgroundMode:ITTSWBackgroundReadable]; + } else if ( [sender indexOfSelectedItem] == 2 ) { + [(ITTSWBackgroundView *)[statusWindow contentView] setBackgroundMode:ITTSWBackgroundColored]; + } + + } else if ( [sender tag] == 3100 ) { + [(ITTSWBackgroundView *)[statusWindow contentView] setBackgroundColor:[sender color]]; } } diff --git a/Showcase/English.lproj/MainMenu.nib/classes.nib b/Showcase/English.lproj/MainMenu.nib/classes.nib index adb8869..a9358a8 100755 --- a/Showcase/English.lproj/MainMenu.nib/classes.nib +++ b/Showcase/English.lproj/MainMenu.nib/classes.nib @@ -28,9 +28,10 @@ statusItemMenu = NSMenu; swBackgroundTypePopup = NSPopUpButton; swDefinedPositionPopup = NSPopUpButton; + swEntrySpeedSlider = NSSlider; + swExitSpeedSlider = NSSlider; swSampleTextView = NSTextView; swShadowSaturation = NSTextField; - swSpeedSlider = NSSlider; swVanishDelay = NSTextField; swVanishModePopup = NSPopUpButton; tabView = ITTabView; @@ -44,9 +45,8 @@ {CLASS = ITBevelView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = ITButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, {CLASS = ITButtonCell; LANGUAGE = ObjC; SUPERCLASS = NSButtonCell; }, - {CLASS = ITGrayRoundedView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, - {CLASS = ITLED; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, {CLASS = ITLEDCell; LANGUAGE = ObjC; SUPERCLASS = NSActionCell; }, + {CLASS = ITTSWBackgroundView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = ITTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; }, {CLASS = ITTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; }, {CLASS = ITTextFieldCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } diff --git a/Showcase/English.lproj/MainMenu.nib/info.nib b/Showcase/English.lproj/MainMenu.nib/info.nib index 192273f..0484bb9 100755 --- a/Showcase/English.lproj/MainMenu.nib/info.nib +++ b/Showcase/English.lproj/MainMenu.nib/info.nib @@ -3,11 +3,11 @@ IBDocumentLocation - 546 7 496 240 0 0 1056 770 + 52 35 496 240 0 0 1056 770 IBEditorPositions 197 - 103 21 153 120 0 0 1056 770 + 564 424 153 99 0 0 1056 770 29 1 271 349 44 0 0 1056 770 diff --git a/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib b/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib index a1dab2a..05d95b0 100755 Binary files a/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib and b/Showcase/English.lproj/MainMenu.nib/keyedobjects.nib differ