From 152714c90a0bc8fe4a4fbc01135fe3b95c051240 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rivaille Date: Mon, 23 Jul 2001 14:31:32 +0000 Subject: [PATCH] (-drawInteriorWithFrame:inView:): updates to have a cuter displaying of NSPopUpButton git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10535 72102866-910b-0410-8b05-ffd578937521 --- Source/NSPopUpButtonCell.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 86fd76add..104a425ef 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -557,7 +557,13 @@ static NSImage *_pbc_image[2]; // cellFrame.origin.x += 5; // cellFrame.size.width -= 5; + cellFrame.origin.x += 2; + cellFrame.size.width -= 2; + [self _drawText: [self titleOfSelectedItem] inFrame: cellFrame]; + + cellFrame.origin.x -= 4; + cellFrame.size.width += 4; anImage = _pbc_image[_pbcFlags.pullsDown]; @@ -565,7 +571,7 @@ static NSImage *_pbc_image[2]; [anImage setBackgroundColor: [NSColor controlBackgroundColor]]; size = [anImage size]; - position.x = cellFrame.origin.x + cellFrame.size.width - size.width - 4; + position.x = cellFrame.origin.x + cellFrame.size.width - size.width; position.y = MAX(NSMidY(cellFrame) - (size.height/2.), 0.); /* * Images are always drawn with their bottom-left corner at the origin @@ -581,6 +587,9 @@ static NSImage *_pbc_image[2]; cellFrame.size.width += 2; } + cellFrame.origin.y -= 1; + cellFrame.size.height += 2; + cellFrame.size.width += 2; if (_cell.shows_first_responder && [[view window] firstResponder] == view) NSDottedFrameRect(cellFrame);