(-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)
{
/* 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;
return cellFrame;
}
@ -353,6 +353,9 @@ static NSImage *arrowImageH = nil;
- (void) drawBorderAndBackgroundWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView
{
if (_mcell_belongs_to_popupbutton)
{
cellFrame.origin.x--;
if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask))
{
NSDrawGrayBezel(cellFrame, NSZeroRect);
@ -361,6 +364,18 @@ static NSImage *arrowImageH = nil;
{
NSDrawButton(cellFrame, NSZeroRect);
}
}
else
{
if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask))
{
NSDrawGrayBezel(cellFrame, NSZeroRect);
}
else
{
NSDrawButton(cellFrame, NSZeroRect);
}
}
}
- (void) drawImageWithFrame: (NSRect)cellFrame
@ -605,7 +620,16 @@ static NSImage *arrowImageH = nil;
// Set cell's background color
[_backgroundColor set];
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