stop redrawing the entire search area every time the chrome redraws, now

only do it when it has focus (bug 213312)
This commit is contained in:
pinkerton%aol.net 2004-01-06 21:27:19 +00:00
Родитель f85d3c12c6
Коммит a33ccc1ec9
2 изменённых файлов: 22 добавлений и 16 удалений

Просмотреть файл

@ -1057,10 +1057,13 @@
};
3003B88B044513FF00B85BF3 = {
fileEncoding = 30;
indentWidth = 2;
isa = PBXFileReference;
name = SearchTextFieldCell.m;
path = src/browser/SearchTextFieldCell.m;
refType = 4;
tabWidth = 2;
usesTabs = 0;
};
3003B88C0445140000B85BF3 = {
fileEncoding = 30;

Просмотреть файл

@ -211,19 +211,22 @@ const float STFSymbolYOffset = 4.0;
[self showSelectedPopUpItem:([self controlView] && ![[self controlView] isFirstResponder])];
// Invalidate the focus ring
[controlView setKeyboardFocusRingNeedsDisplayInRect:cellFrame];
// Draw a custom focus ring if necessary
if (wasShowingFirstResponder && [[controlView window] isKeyWindow]) {
[NSGraphicsContext saveGraphicsState];
NSSetFocusRingStyle(NSFocusRingOnly);
[[self fieldOutlinePathForRect:cellFrame] fill];
[NSGraphicsContext restoreGraphicsState];
// Invalidate the focus ring to draw/undraw it depending on if we're in the
// key window. This will cause us to redraw the entire text field cell every time
// the insertion point flashes, but only then (it used to redraw any time anything in
// the chrome changed).
if (wasShowingFirstResponder) {
[controlView setKeyboardFocusRingNeedsDisplayInRect:cellFrame];
if ([[controlView window] isKeyWindow]) {
[NSGraphicsContext saveGraphicsState];
NSSetFocusRingStyle(NSFocusRingOnly);
[[self fieldOutlinePathForRect:cellFrame] fill];
[NSGraphicsContext restoreGraphicsState];
}
}
// Draw the text field
[self setShowsFirstResponder:NO];
[super drawWithFrame:[self textFieldRectFromRect:cellFrame] inView:controlView];
@ -289,7 +292,7 @@ const float STFSymbolYOffset = 4.0;
// Start at the top left of the middle section
aPoint.x = aRect.origin.x + [_leftImage size].width;
aPoint.y = NSMaxY(aRect) - 1.0;
aPoint.y = NSMaxY(aRect) - 2.0;
[fieldOutlinePath moveToPoint:aPoint];
// Trace to the top right of the middle section
@ -299,15 +302,15 @@ const float STFSymbolYOffset = 4.0;
// Trace around the right curve to the bottom right of the middle section
aPoint.y = aRect.origin.y;
[fieldOutlinePath curveToPoint:aPoint
controlPoint1:NSMakePoint(aPoint.x + 13.0, NSMaxY(aRect))
controlPoint2:NSMakePoint(aPoint.x + 13.0, aPoint.y)];
controlPoint1:NSMakePoint(aPoint.x + 11.0, NSMaxY(aRect))
controlPoint2:NSMakePoint(aPoint.x + 11.0, aPoint.y)];
// Trace to the bottom left of the middle section
aPoint.x = aRect.origin.x + [_leftImage size].width;
[fieldOutlinePath lineToPoint:aPoint];
// Trace around the left curve to the top left of the middle section, i.e. the beginning
aPoint.y = NSMaxY(aRect) - 1.0;
aPoint.y = NSMaxY(aRect) - 2.0;
[fieldOutlinePath curveToPoint:aPoint
controlPoint1:NSMakePoint(aPoint.x - 11.0, aRect.origin.y)
controlPoint2:NSMakePoint(aPoint.x - 11.0, aPoint.y)];