mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 18:50:48 +00:00
Factor out table header cell drawing into a new GSTheme method,
-drawTableHeaderCell:withFrame:inView:state: git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29431 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
775d9caf51
commit
5fa5e2a83b
4 changed files with 38 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2010-01-28 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||||
|
* Source/NSTableHeaderCell.m:
|
||||||
|
* Source/GSThemeDrawing.m: Factor out table header cell drawing into
|
||||||
|
a new GSTheme method,
|
||||||
|
-drawTableHeaderCell:withFrame:inView:state:
|
||||||
|
|
||||||
2010-01-27 Eric Wasylishen <ewasylishen@gmail.com>
|
2010-01-27 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||||
|
|
|
@ -238,6 +238,7 @@
|
||||||
@class NSMenuItemCell;
|
@class NSMenuItemCell;
|
||||||
@class NSMenuView;
|
@class NSMenuView;
|
||||||
@class NSProgressIndicator;
|
@class NSProgressIndicator;
|
||||||
|
@class NSTableHeaderCell;
|
||||||
@class GSDrawTiles;
|
@class GSDrawTiles;
|
||||||
|
|
||||||
/* First, declare names used for obtaining colors and/or tiles for specific
|
/* First, declare names used for obtaining colors and/or tiles for specific
|
||||||
|
@ -869,7 +870,10 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
|
||||||
// Table drawing methods
|
// Table drawing methods
|
||||||
- (void) drawTableCornerView: (NSView*)cornerView
|
- (void) drawTableCornerView: (NSView*)cornerView
|
||||||
withClip: (NSRect)aRect;
|
withClip: (NSRect)aRect;
|
||||||
|
- (void) drawTableHeaderCell: (NSTableHeaderCell *)cell
|
||||||
|
withFrame: (NSRect)cellFrame
|
||||||
|
inView: (NSView *)controlView
|
||||||
|
state: (GSThemeControlState)state;
|
||||||
|
|
||||||
- (float) titlebarHeight;
|
- (float) titlebarHeight;
|
||||||
|
|
||||||
|
|
|
@ -945,6 +945,22 @@ static NSImage *spinningImages[MaxCount];
|
||||||
NSRectFill(rect);
|
NSRectFill(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) drawTableHeaderCell: (NSTableHeaderCell *)cell
|
||||||
|
withFrame: (NSRect)cellFrame
|
||||||
|
inView: (NSView *)controlView
|
||||||
|
state: (GSThemeControlState)state
|
||||||
|
{
|
||||||
|
if (state == GSThemeHighlightedState)
|
||||||
|
{
|
||||||
|
[self drawButton: cellFrame withClip: cellFrame];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self drawDarkButton: cellFrame withClip: cellFrame];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Window decoration drawing methods
|
// Window decoration drawing methods
|
||||||
/* These include the black border. */
|
/* These include the black border. */
|
||||||
#define TITLE_HEIGHT 23.0
|
#define TITLE_HEIGHT 23.0
|
||||||
|
|
|
@ -64,15 +64,22 @@
|
||||||
- (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame
|
- (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame
|
||||||
inView: (NSView*)controlView
|
inView: (NSView*)controlView
|
||||||
{
|
{
|
||||||
|
GSThemeControlState state;
|
||||||
if (_cell.is_highlighted == YES)
|
if (_cell.is_highlighted == YES)
|
||||||
{
|
{
|
||||||
[[GSTheme theme] drawButton: cellFrame withClip: cellFrame];
|
state = GSThemeHighlightedState;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[[GSTheme theme] drawDarkButton: cellFrame withClip: cellFrame];
|
state = GSThemeNormalState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[GSTheme theme] drawTableHeaderCell: self
|
||||||
|
withFrame: cellFrame
|
||||||
|
inView: controlView
|
||||||
|
state: state];
|
||||||
|
|
||||||
|
// Draw the label
|
||||||
[self _drawBackgroundWithFrame: cellFrame inView: controlView];
|
[self _drawBackgroundWithFrame: cellFrame inView: controlView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue