mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 21:00:47 +00:00
Create a new GSTheme method for drawing the background of NSMenuView,
-drawBackgroundForMenuView:withFrame:dirtyRect:horizontal: git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29430 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0614c779b0
commit
775d9caf51
4 changed files with 40 additions and 16 deletions
|
@ -1,5 +1,13 @@
|
||||||
2010-01-27 Eric Wasylishen <ewasylishen@gmail.com>
|
2010-01-27 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||||
|
* Source/NSMenuView.m:
|
||||||
|
* Source/GSThemeDrawing.m:
|
||||||
|
Create a new GSTheme method for drawing the background of NSMenuView,
|
||||||
|
-drawBackgroundForMenuView:withFrame:dirtyRect:horizontal:
|
||||||
|
|
||||||
|
10-01-27 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/GSThemeDrawing.m: Undo an accidental commit of some testing
|
* Source/GSThemeDrawing.m: Undo an accidental commit of some testing
|
||||||
code in r29416
|
code in r29416
|
||||||
|
|
||||||
|
|
|
@ -832,6 +832,10 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
|
||||||
withFrame: (NSRect) aRect
|
withFrame: (NSRect) aRect
|
||||||
position: (NSPoint) position;
|
position: (NSPoint) position;
|
||||||
|
|
||||||
|
- (void) drawBackgroundForMenuView: (NSMenuView*)menuView
|
||||||
|
withFrame: (NSRect)bounds
|
||||||
|
dirtyRect: (NSRect)dirtyRect
|
||||||
|
horizontal: (BOOL)horizontal;
|
||||||
|
|
||||||
// menu item cell drawing method
|
// menu item cell drawing method
|
||||||
- (void) drawBorderAndBackgroundForMenuItemCell: (NSMenuItemCell *)cell
|
- (void) drawBorderAndBackgroundForMenuItemCell: (NSMenuItemCell *)cell
|
||||||
|
|
|
@ -679,6 +679,29 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) drawBackgroundForMenuView: (NSMenuView*)menuView
|
||||||
|
withFrame: (NSRect)bounds
|
||||||
|
dirtyRect: (NSRect)dirtyRect
|
||||||
|
horizontal: (BOOL)horizontal
|
||||||
|
{
|
||||||
|
NSRectEdge sides[2];
|
||||||
|
float grays[] = {NSDarkGray, NSDarkGray};
|
||||||
|
|
||||||
|
if (horizontal == YES)
|
||||||
|
{
|
||||||
|
sides[0] = NSMinYEdge;
|
||||||
|
sides[1] = NSMinYEdge;
|
||||||
|
NSDrawTiledRects(bounds, dirtyRect, sides, grays, 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sides[0] = NSMinXEdge;
|
||||||
|
sides[1] = NSMaxYEdge;
|
||||||
|
// Draw the dark gray upper left lines.
|
||||||
|
NSDrawTiledRects(bounds, dirtyRect, sides, grays, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) drawBorderAndBackgroundForMenuItemCell: (NSMenuItemCell *)cell
|
- (void) drawBorderAndBackgroundForMenuItemCell: (NSMenuItemCell *)cell
|
||||||
withFrame: (NSRect)cellFrame
|
withFrame: (NSRect)cellFrame
|
||||||
inView: (NSView *)controlView
|
inView: (NSView *)controlView
|
||||||
|
|
|
@ -1223,23 +1223,12 @@ static NSMapTable *viewInfo = 0;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int howMany = [_itemCells count];
|
int howMany = [_itemCells count];
|
||||||
NSRectEdge sides[2];
|
|
||||||
float grays[] = {NSDarkGray, NSDarkGray};
|
|
||||||
|
|
||||||
if (_horizontal == YES)
|
[[GSTheme theme] drawBackgroundForMenuView: self
|
||||||
{
|
withFrame: _bounds
|
||||||
sides[0] = NSMinYEdge;
|
dirtyRect: rect
|
||||||
sides[1] = NSMinYEdge;
|
horizontal: _horizontal];
|
||||||
NSDrawTiledRects(_bounds, rect, sides, grays, 2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sides[0] = NSMinXEdge;
|
|
||||||
sides[1] = NSMaxYEdge;
|
|
||||||
// Draw the dark gray upper left lines.
|
|
||||||
NSDrawTiledRects(_bounds, rect, sides, grays, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw the menu cells.
|
// Draw the menu cells.
|
||||||
for (i = 0; i < howMany; i++)
|
for (i = 0; i < howMany; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue