mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:27:40 +00:00
Fixes for nspopupbutton
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4678 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cf61ae7e46
commit
97f15c9e67
5 changed files with 41 additions and 14 deletions
|
@ -82,26 +82,32 @@
|
|||
if (cell_image)
|
||||
{
|
||||
[self _drawImage:cell_image inFrame:cellFrame];
|
||||
return;
|
||||
|
||||
rect.size.width = 5; // calc image rect
|
||||
rect.size.height = 11;
|
||||
rect.origin.x = cellFrame.origin.x + cellFrame.size.width - 8;
|
||||
rect.origin.y = cellFrame.origin.y + 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
[cell_font set];
|
||||
|
||||
[cell_font set];
|
||||
point.y = rect.origin.y + (rect.size.height/2) - 4;
|
||||
point.x = rect.origin.x + xDist;
|
||||
rect.origin = point;
|
||||
|
||||
point.y = rect.origin.y + (rect.size.height/2) - 4;
|
||||
point.x = rect.origin.x + xDist;
|
||||
rect.origin = point;
|
||||
|
||||
[[NSColor blackColor] set];
|
||||
[[NSColor blackColor] set];
|
||||
|
||||
// Draw the title.
|
||||
// Draw the title.
|
||||
|
||||
DPSmoveto(ctxt, rect.origin.x, rect.origin.y);
|
||||
DPSshow(ctxt, [contents cString]);
|
||||
DPSmoveto(ctxt, rect.origin.x, rect.origin.y);
|
||||
DPSshow(ctxt, [contents cString]);
|
||||
|
||||
rect.size.width = 15; // calc image rect
|
||||
rect.size.height = cellFrame.size.height;
|
||||
rect.origin.x = cellFrame.origin.x + cellFrame.size.width - (6 + 11);
|
||||
rect.origin.y = cellFrame.origin.y;
|
||||
rect.size.width = 15; // calc image rect
|
||||
rect.size.height = cellFrame.size.height;
|
||||
rect.origin.x = cellFrame.origin.x + cellFrame.size.width - (6 + 11);
|
||||
rect.origin.y = cellFrame.origin.y;
|
||||
}
|
||||
|
||||
if ([view isKindOfClass:[NSMenuView class]])
|
||||
{
|
||||
|
@ -114,6 +120,13 @@
|
|||
else
|
||||
[super _drawImage:[NSImage imageNamed:@"common_3DArrowDown"] inFrame:rect];
|
||||
}
|
||||
else if ([[[popb selectedItem] representedObject] isEqual: cell_image])
|
||||
{
|
||||
if ([popb pullsDown] == NO)
|
||||
[super _drawImage:[NSImage imageNamed:@"common_UpAndDownArrowSmall.tiff"] inFrame:rect];
|
||||
else
|
||||
[super _drawImage:[NSImage imageNamed:@"common_DownArrowSmall"] inFrame:rect];
|
||||
}
|
||||
}
|
||||
else if ([view isKindOfClass:[NSPopUpButton class]])
|
||||
{
|
||||
|
@ -125,6 +138,13 @@
|
|||
else
|
||||
[super _drawImage:[NSImage imageNamed:@"common_3DArrowDown"] inFrame:rect];
|
||||
}
|
||||
else if ([[[(NSPopUpButton *)view selectedItem] representedObject] isEqual: cell_image])
|
||||
{
|
||||
if ([(NSPopUpButton *)view pullsDown] == NO)
|
||||
[super _drawImage:[NSImage imageNamed:@"common_UpAndDownArrowSmall"] inFrame:rect];
|
||||
else
|
||||
[super _drawImage:[NSImage imageNamed:@"common_DownArrowSmall"] inFrame:rect];
|
||||
}
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue