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:
Gregory John Casamento 2010-11-26 20:28:45 +00:00
parent eac1ad07ad
commit 72963b2f49
4 changed files with 50 additions and 21 deletions

View file

@ -1,3 +1,11 @@
2010-11-26 Gregory John Casamento <greg.casamento@gmail.com>
* Source/GSThemeDrawing.m: Added method to draw NSBrowser view.
* Source/NSMenuView.m: Added call in drawRect: to new drawing method
in GSTheme.
* Headers/Additions/GNUstepGUI/GSTheme.h:
Added declaration for new method.
2010-11-26 Gregory John Casamento <greg.casamento@gmail.com>
* Source/GSThemeDrawing.m: Added method to draw NSBrowser view.

View file

@ -949,6 +949,11 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
inView: (NSView *)view
withScrollerRect: (NSRect)scrollerRect
columnSize: (NSSize)columnSize;
- (void) drawMenuRect: (NSRect)rect
inView: (NSView *)view
isHorizontal: (BOOL)horizontal
itemCells: (NSArray *)itemCells;
@end
/**

View file

@ -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

View file

@ -1320,27 +1320,10 @@ static NSMapTable *viewInfo = 0;
- (void) drawRect: (NSRect)rect
{
int i;
int howMany = [_itemCells count];
[[GSTheme theme] drawBackgroundForMenuView: self
withFrame: _bounds
dirtyRect: rect
horizontal: _horizontal];
// Draw the menu cells.
for (i = 0; i < howMany; i++)
{
NSRect aRect;
NSMenuItemCell *aCell;
aRect = [self rectOfItemAtIndex: i];
if (NSIntersectsRect(rect, aRect) == YES)
{
aCell = [self menuItemCellForItemAtIndex: i];
[aCell drawWithFrame: aRect inView: self];
}
}
[[GSTheme theme] drawMenuRect: rect
inView: self
isHorizontal: _horizontal
itemCells: _itemCells];
}
/*