diff --git a/ChangeLog b/ChangeLog index 9cf0dbf8c..36205c2d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-09 Fred Kiefer + + * Source/NSTableView.m: Indentation changes. + * Source/NSTextFieldCell.m ([-drawInteriorWithFrame:inView:]): + Move editing check from here to ... + * Source/NSControl.m (-drawRect:): ... here. + 2008-06-02 Fred Kiefer * Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:): diff --git a/Source/NSControl.m b/Source/NSControl.m index 061273855..263c002da 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -625,6 +625,18 @@ static NSNotificationCenter *nc; - (void) drawRect: (NSRect)aRect { + /* Do nothing if there is already a text editor doing the drawing; + * otherwise, we draw everything twice. That is bad if there are + * any transparency involved (eg, even an anti-alias font!) because + * if the semi-transparent pixels are drawn over themselves they + * become less transparent (eg, an anti-alias font becomes darker + * and gives the impression of being bold). + */ + if ([self currentEditor] != nil) + { + return; + } + [self drawCell: _cell]; } diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 10b10272d..8b03e2c1f 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -3254,9 +3254,9 @@ byExtendingSelection: (BOOL)flag } - (void) editColumn: (int) columnIndex - row: (int) rowIndex - withEvent: (NSEvent *) theEvent - select: (BOOL) flag + row: (int) rowIndex + withEvent: (NSEvent *) theEvent + select: (BOOL) flag { NSText *t; NSTableColumn *tb; @@ -5188,7 +5188,7 @@ static BOOL selectContiguousRegion(NSTableView *self, for (i = startingRow; i <= endingRow; i++) { - (*imp)(self, sel, i, aRect); + (*imp)(self, sel, i, aRect); } } } @@ -5924,10 +5924,10 @@ static BOOL selectContiguousRegion(NSTableView *self, if ([self _isCellEditableColumn: column row:row]) { - [self editColumn: column - row: row - withEvent: nil - select: YES]; + [self editColumn: column + row: row + withEvent: nil + select: YES]; } } } diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index 37f5db9d2..8ec84a1cd 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -235,31 +235,20 @@ static NSColor *txtCol; - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { - /* Do nothing if there is already a text editor doing the drawing; - * otherwise, we draw everything twice. That is bad if there are - * any transparency involved (eg, even an anti-alias font!) because - * if the semi-transparent pixels are drawn over themselves they - * become less transparent (eg, an anti-alias font becomes darker - * and gives the impression of being bold). - */ - if (([controlView respondsToSelector: @selector(currentEditor)] == NO) - || ([(NSTextField *)controlView currentEditor] == nil)) - { - if (_textfieldcell_draws_background) - { - if ([self isEnabled]) - { - [_background_color set]; - } - else - { - [[NSColor controlBackgroundColor] set]; - } - NSRectFill([self drawingRectForBounds: cellFrame]); - } - - [super drawInteriorWithFrame: cellFrame inView: controlView]; + if (_textfieldcell_draws_background) + { + if ([self isEnabled]) + { + [_background_color set]; + } + else + { + [[NSColor controlBackgroundColor] set]; + } + NSRectFill([self drawingRectForBounds: cellFrame]); } + + [super drawInteriorWithFrame: cellFrame inView: controlView]; } /*