mirror of
https://github.com/transmission/transmission.git
synced 2026-04-17 23:54:19 +01:00
before applying the gradient to the status and filter bars, check that the remaining rect is not empty
This commit is contained in:
@@ -80,10 +80,13 @@
|
||||
rect.size.height -= 1.0;
|
||||
}
|
||||
|
||||
NSRectFillListWithColors(gridRects, colorRects, count);
|
||||
if (!NSIsEmptyRect(rect))
|
||||
{
|
||||
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
|
||||
[fGradient drawInRect: gradientRect angle: 270.0];
|
||||
}
|
||||
|
||||
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
|
||||
[fGradient drawInRect: gradientRect angle: 270.0];
|
||||
NSRectFillListWithColors(gridRects, colorRects, count);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -99,16 +99,19 @@
|
||||
rect.size.height -= 1.0;
|
||||
}
|
||||
|
||||
if (active)
|
||||
if (!NSIsEmptyRect(rect))
|
||||
{
|
||||
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
|
||||
[fGradient drawInRect: gradientRect angle: 270.0];
|
||||
}
|
||||
else
|
||||
{
|
||||
gridRects[count] = rect;
|
||||
colorRects[count] = [NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0];
|
||||
++count;
|
||||
if (active)
|
||||
{
|
||||
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
|
||||
[fGradient drawInRect: gradientRect angle: 270.0];
|
||||
}
|
||||
else
|
||||
{
|
||||
gridRects[count] = rect;
|
||||
colorRects[count] = [NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0];
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
NSRectFillListWithColors(gridRects, colorRects, count);
|
||||
|
||||
Reference in New Issue
Block a user