mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:07:39 +00:00
Set backgrounds of images before drawing them.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4184 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ae7f99c597
commit
6847940a3e
3 changed files with 29 additions and 15 deletions
|
@ -414,7 +414,7 @@
|
|||
NSString *titleToDisplay;
|
||||
NSSize imageSize = {0, 0};
|
||||
NSRect rect;
|
||||
float backgroundGray = NSLightGray;
|
||||
NSColor *backgroundColor = [NSColor controlBackgroundColor];
|
||||
|
||||
cellFrame = NSInsetRect(cellFrame, xDist, yDist);
|
||||
|
||||
|
@ -423,18 +423,18 @@
|
|||
{
|
||||
if ( [self showsStateBy]
|
||||
& (NSChangeGrayCellMask | NSChangeBackgroundCellMask) )
|
||||
backgroundGray = NSWhite;
|
||||
backgroundColor = [NSColor selectedControlColor];
|
||||
}
|
||||
|
||||
if ([self isHighlighted])
|
||||
{
|
||||
if ( [self highlightsBy]
|
||||
& (NSChangeGrayCellMask | NSChangeBackgroundCellMask) )
|
||||
backgroundGray = NSWhite;
|
||||
backgroundColor = [NSColor selectedControlColor];
|
||||
}
|
||||
|
||||
// set cell's background color
|
||||
[[NSColor colorWithCalibratedWhite: backgroundGray alpha: 1.0] set];
|
||||
[backgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
|
||||
// Determine the image and the title that will be
|
||||
|
@ -465,7 +465,10 @@
|
|||
}
|
||||
|
||||
if (imageToDisplay)
|
||||
imageSize = [imageToDisplay size];
|
||||
{
|
||||
imageSize = [imageToDisplay size];
|
||||
[imageToDisplay setBackgroundColor: backgroundColor];
|
||||
}
|
||||
|
||||
rect = NSMakeRect (cellFrame.origin.x, cellFrame.origin.y,
|
||||
imageSize.width, imageSize.height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue