Corrected and cleaned up focus ring drawing for cell classes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24924 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2007-03-22 17:47:56 +00:00
parent a71c8a1b9a
commit 77332bb584
6 changed files with 40 additions and 18 deletions

View file

@ -1,3 +1,13 @@
2007-03-22 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSButtonCell.m (-drawWithFrame:inView:),
* Source/NSCell.m (-drawWithFrame:inView:): Respect focus ring
style when drawing first responder state.
* Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:),
* Source/NSPopupButtonCell.m (-drawInteriorWithFrame:inView:),
* Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Don't
draw focus ring.
2007-03-22 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSAffineTransform.m: Avoid accessing internals of the base

View file

@ -323,9 +323,6 @@ static NSFont *_leafFont;
// Draw the body of the cell
[self _drawAttributedText: [self attributedStringValue]
inFrame: title_rect];
if (_cell.shows_first_responder == YES)
NSDottedFrameRect(cellFrame);
}
- (BOOL) isOpaque

View file

@ -948,9 +948,21 @@ typedef struct _GSButtonCellFlags
if (_cell.shows_first_responder
&& [[controlView window] firstResponder] == controlView)
{
// FIXME: Should depend on _cell.focus_ring_type
[[GSTheme theme] drawFocusFrame: [self drawingRectForBounds: cellFrame]
view: controlView];
switch (_cell.focus_ring_type)
{
case NSFocusRingTypeDefault:
[[GSTheme theme] drawFocusFrame: [self drawingRectForBounds:
cellFrame]
view: controlView];
break;
case NSFocusRingTypeExterior:
[[GSTheme theme] drawFocusFrame: cellFrame
view: controlView];
break;
case NSFocusRingTypeNone:
default:
break;
}
}
}

View file

@ -2019,9 +2019,21 @@ static NSColor *shadowCol;
if (_cell.shows_first_responder
&& [[controlView window] firstResponder] == controlView)
{
// FIXME: Should depend on _cell.focus_ring_type
[[GSTheme theme] drawFocusFrame: [self drawingRectForBounds: cellFrame]
view: controlView];
switch (_cell.focus_ring_type)
{
case NSFocusRingTypeDefault:
[[GSTheme theme] drawFocusFrame: [self drawingRectForBounds:
cellFrame]
view: controlView];
break;
case NSFocusRingTypeExterior:
[[GSTheme theme] drawFocusFrame: cellFrame
view: controlView];
break;
case NSFocusRingTypeNone:
default:
break;
}
}
}

View file

@ -301,9 +301,6 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect)
realImageSize.height)
operation: NSCompositeSourceOver
fraction: 1.0];
if (_cell.shows_first_responder)
NSDottedFrameRect(cellFrame);
}
- (NSSize) cellSize

View file

@ -888,12 +888,6 @@ static NSImage *_pbc_image[2];
[self calcSize];
[super drawInteriorWithFrame: cellFrame inView: controlView];
if (_cell.shows_first_responder)
{
cellFrame = [self drawingRectForBounds: cellFrame];
NSDottedFrameRect(cellFrame);
}
/* Unset the item to restore balance if a new was created */
if (new)
{