mirror of
https://github.com/transmission/transmission
synced 2025-03-13 07:33:02 +00:00
slightly more efficient drawing in the status bar (avoids filling in the whole bar and then drawing lines on top of it)
This commit is contained in:
parent
79931a5b6a
commit
dbcbd99bf0
1 changed files with 9 additions and 6 deletions
|
@ -58,16 +58,13 @@
|
|||
{
|
||||
if (fShow)
|
||||
{
|
||||
[[NSColor controlColor] set];
|
||||
NSRectFill(rect);
|
||||
|
||||
NSRect bounds = [self bounds];
|
||||
|
||||
NSRect lineBorderRect = NSMakeRect(bounds.origin.x, NSMaxY(bounds) - 1.0, bounds.size.width, 1.0);
|
||||
NSRect lineBorderRect = NSMakeRect(rect.origin.x, NSMaxY([self bounds]) - 1.0, rect.size.width, 1.0);
|
||||
if (NSIntersectsRect(lineBorderRect, rect))
|
||||
{
|
||||
[[NSColor whiteColor] set];
|
||||
NSRectFill(lineBorderRect);
|
||||
|
||||
rect.size.height--;
|
||||
}
|
||||
|
||||
lineBorderRect.origin.y = 0.0;
|
||||
|
@ -75,7 +72,13 @@
|
|||
{
|
||||
[fGrayBorderColor set];
|
||||
NSRectFill(lineBorderRect);
|
||||
|
||||
rect.origin.y++;
|
||||
rect.size.height--;
|
||||
}
|
||||
|
||||
[[NSColor controlColor] set];
|
||||
NSRectFill(rect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue