mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 06:50:38 +00:00
Added theming for NSMenuView into GSTheme.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31660 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eac1ad07ad
commit
72963b2f49
4 changed files with 50 additions and 21 deletions
|
@ -38,6 +38,7 @@
|
|||
#import "AppKit/NSColorWell.h"
|
||||
#import "AppKit/NSGraphics.h"
|
||||
#import "AppKit/NSImage.h"
|
||||
#import "AppKit/NSMenuView.h"
|
||||
#import "AppKit/NSMenuItemCell.h"
|
||||
#import "AppKit/NSParagraphStyle.h"
|
||||
#import "AppKit/NSProgressIndicator.h"
|
||||
|
@ -1902,4 +1903,36 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) drawMenuRect: (NSRect)rect
|
||||
inView: (NSView *)view
|
||||
isHorizontal: (BOOL)horizontal
|
||||
itemCells: (NSArray *)itemCells
|
||||
{
|
||||
|
||||
int i = 0;
|
||||
int howMany = [itemCells count];
|
||||
NSMenuView *menuView = (NSMenuView *)view;
|
||||
NSRect bounds = [view bounds];
|
||||
|
||||
[self drawBackgroundForMenuView: menuView
|
||||
withFrame: bounds
|
||||
dirtyRect: rect
|
||||
horizontal: horizontal];
|
||||
|
||||
// Draw the menu cells.
|
||||
for (i = 0; i < howMany; i++)
|
||||
{
|
||||
NSRect aRect;
|
||||
NSMenuItemCell *aCell;
|
||||
|
||||
aRect = [menuView rectOfItemAtIndex: i];
|
||||
if (NSIntersectsRect(rect, aRect) == YES)
|
||||
{
|
||||
aCell = [menuView menuItemCellForItemAtIndex: i];
|
||||
[aCell drawWithFrame: aRect inView: menuView];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue