mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 09:00:56 +00:00
(-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:
parent
152714c90a
commit
fe81258f70
1 changed files with 29 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue