diff options
author | avenjamin <avenjamin@gmail.com> | 2009-12-20 01:19:52 +0000 |
---|---|---|
committer | avenjamin <avenjamin@gmail.com> | 2009-12-20 01:19:52 +0000 |
commit | ea1b48967ce34718d2645c4a30fab6b67e66f9fa (patch) | |
tree | a51ebe2f74a0c8e6c89f085df4240336c98aedf7 /Frameworks/BWToolkitFramework.framework/BWTransparentTableViewCell.m | |
parent | c25a2f4561a4cde2d2d9a431cd941704d79bb428 (diff) | |
download | sequelpro-ea1b48967ce34718d2645c4a30fab6b67e66f9fa.tar.gz sequelpro-ea1b48967ce34718d2645c4a30fab6b67e66f9fa.tar.bz2 sequelpro-ea1b48967ce34718d2645c4a30fab6b67e66f9fa.zip |
- Updating Growl to 1.2
- Updating BWToolkit to 1.2.2
- Changed BWToolkit from building it ourselves to just include the latest release of the framework
- Changed build settings to build 32 and 64 universal binaries
- Changed compiler to Clang
Diffstat (limited to 'Frameworks/BWToolkitFramework.framework/BWTransparentTableViewCell.m')
-rw-r--r-- | Frameworks/BWToolkitFramework.framework/BWTransparentTableViewCell.m | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/Frameworks/BWToolkitFramework.framework/BWTransparentTableViewCell.m b/Frameworks/BWToolkitFramework.framework/BWTransparentTableViewCell.m deleted file mode 100644 index 33f13e02..00000000 --- a/Frameworks/BWToolkitFramework.framework/BWTransparentTableViewCell.m +++ /dev/null @@ -1,85 +0,0 @@ -// -// BWTransparentTableViewCell.m -// BWToolkit -// -// Created by Brandon Walkin (www.brandonwalkin.com) -// All code is provided under the New BSD license. -// - -#import "BWTransparentTableViewCell.h" - -@implementation BWTransparentTableViewCell - -- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView -{ - if (![[self title] isEqualToString:@""]) - { - NSColor *textColor; - - if (!self.isHighlighted) - textColor = [NSColor colorWithCalibratedWhite:(198.0f / 255.0f) alpha:1]; - else - textColor = [NSColor whiteColor]; - - NSMutableDictionary *attributes = [[[NSMutableDictionary alloc] init] autorelease]; - [attributes addEntriesFromDictionary:[[self attributedStringValue] attributesAtIndex:0 effectiveRange:NULL]]; - [attributes setObject:textColor forKey:NSForegroundColorAttributeName]; - [attributes setObject:[NSFont systemFontOfSize:11] forKey:NSFontAttributeName]; - - NSMutableAttributedString *string = [[[NSMutableAttributedString alloc] initWithString:[self title] attributes:attributes] autorelease]; - [self setAttributedStringValue:string]; - } - - cellFrame.size.width -= 1; - cellFrame.origin.x += 1; - [super drawInteriorWithFrame:cellFrame inView:controlView]; -} - -#pragma mark RSVerticallyCenteredTextFieldCell -// RSVerticallyCenteredTextFieldCell courtesy of Daniel Jalkut -// http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes - -- (NSRect)drawingRectForBounds:(NSRect)theRect -{ - // Get the parent's idea of where we should draw - NSRect newRect = [super drawingRectForBounds:theRect]; - - // When the text field is being - // edited or selected, we have to turn off the magic because it screws up - // the configuration of the field editor. We sneak around this by - // intercepting selectWithFrame and editWithFrame and sneaking a - // reduced, centered rect in at the last minute. - if (mIsEditingOrSelecting == NO) - { - // Get our ideal size for current text - NSSize textSize = [self cellSizeForBounds:theRect]; - - // Center that in the proposed rect - float heightDelta = newRect.size.height - textSize.height; - if (heightDelta > 0) - { - newRect.size.height -= heightDelta; - newRect.origin.y += (heightDelta / 2); - } - } - - return newRect; -} - -- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength -{ - aRect = [self drawingRectForBounds:aRect]; - mIsEditingOrSelecting = YES; - [super selectWithFrame:aRect inView:controlView editor:textObj delegate:anObject start:selStart length:selLength]; - mIsEditingOrSelecting = NO; -} - -- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent -{ - aRect = [self drawingRectForBounds:aRect]; - mIsEditingOrSelecting = YES; - [super editWithFrame:aRect inView:controlView editor:textObj delegate:anObject event:theEvent]; - mIsEditingOrSelecting = NO; -} - -@end |