(-imageRectForBounds:), (-drawBorderAndBackgroundWithFrame:inView:),

(-drawInteriorWithFrame:inView:): updates to have a cuter displaying of
NSPopUpButton


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10536 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Pierre-Yves Rivaille 2001-07-23 14:32:38 +00:00
parent 152714c90a
commit fe81258f70

View file

@ -245,7 +245,7 @@ static NSImage *arrowImageH = nil;
if (_mcell_belongs_to_popupbutton && _cell.image_position) if (_mcell_belongs_to_popupbutton && _cell.image_position)
{ {
/* Special case: draw image on the extreme right [FIXME check the distance]*/ /* Special case: draw image on the extreme right [FIXME check the distance]*/
cellFrame.origin.x += cellFrame.size.width - mcell_imageWidth - 2; cellFrame.origin.x += cellFrame.size.width - mcell_imageWidth - 4;
cellFrame.size.width = mcell_imageWidth; cellFrame.size.width = mcell_imageWidth;
return cellFrame; return cellFrame;
} }
@ -353,13 +353,28 @@ static NSImage *arrowImageH = nil;
- (void) drawBorderAndBackgroundWithFrame:(NSRect)cellFrame - (void) drawBorderAndBackgroundWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView inView:(NSView *)controlView
{ {
if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask)) if (_mcell_belongs_to_popupbutton)
{ {
NSDrawGrayBezel(cellFrame, NSZeroRect); cellFrame.origin.x--;
if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask))
{
NSDrawGrayBezel(cellFrame, NSZeroRect);
}
else
{
NSDrawButton(cellFrame, NSZeroRect);
}
} }
else else
{ {
NSDrawButton(cellFrame, NSZeroRect); if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask))
{
NSDrawGrayBezel(cellFrame, NSZeroRect);
}
else
{
NSDrawButton(cellFrame, NSZeroRect);
}
} }
} }
@ -605,7 +620,16 @@ static NSImage *arrowImageH = nil;
// Set cell's background color // Set cell's background color
[_backgroundColor set]; [_backgroundColor set];
NSRectFill(cellFrame); if (_mcell_belongs_to_popupbutton)
{
cellFrame.origin.x--;
NSRectFill(cellFrame);
cellFrame.origin.x++;
}
else
{
NSRectFill(cellFrame);
}
/* /*
* Determine the image and the title that will be * Determine the image and the title that will be