Check in the control not in the text field whether the cell is currently

being edited.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26613 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2008-06-09 10:04:49 +00:00
parent 3d9091f2d4
commit d2cdcf7415
4 changed files with 40 additions and 32 deletions

View file

@ -1,3 +1,10 @@
2008-06-09 Fred Kiefer <FredKiefer@gmx.de>
* 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 <FredKiefer@gmx.de> 2008-06-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:): * Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:):

View file

@ -625,6 +625,18 @@ static NSNotificationCenter *nc;
- (void) drawRect: (NSRect)aRect - (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]; [self drawCell: _cell];
} }

View file

@ -234,16 +234,6 @@ static NSColor *txtCol;
} }
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView - (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 (_textfieldcell_draws_background)
{ {
@ -260,7 +250,6 @@ static NSColor *txtCol;
[super drawInteriorWithFrame: cellFrame inView: controlView]; [super drawInteriorWithFrame: cellFrame inView: controlView];
} }
}
/* /*
Attributed string that will be displayed. Attributed string that will be displayed.