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)
|
||||
{
|
||||
/* 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
|
||||
|
|
Loading…
Reference in a new issue