mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
committed by
Martin Carlberg
parent
f02d0ab1dd
commit
c0ee5f6563
@@ -23,31 +23,26 @@
|
||||
@import <AppKit/CPTableHeaderView.j>
|
||||
|
||||
@class CPTableView
|
||||
@class Nib2Cib
|
||||
|
||||
|
||||
@implementation CPTableHeaderView (NSCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
if (self = [super NS_initWithCoder:aCoder])
|
||||
{
|
||||
_tableView = [aCoder decodeObjectForKey:"NSTableView"];
|
||||
|
||||
// change the default height
|
||||
if (_bounds.size.height === 17)
|
||||
{
|
||||
var theme = [Nib2Cib defaultTheme],
|
||||
height = [theme valueForAttributeWithName:@"header-view-height" forClass:CPTableView];
|
||||
|
||||
_bounds.size.height = height;
|
||||
_frame.size.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)_setHeightIfDefaultValue:(CPInteger)height
|
||||
{
|
||||
if (_bounds.size.height === 17)
|
||||
{
|
||||
_bounds.size.height = height;
|
||||
_frame.size.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSTableHeaderView : CPTableHeaderView
|
||||
|
||||
@@ -86,6 +86,13 @@
|
||||
_allowsColumnReordering = (flags & 0x80000000) ? YES : NO;
|
||||
|
||||
[self setBackgroundColor:[aCoder decodeObjectForKey:@"NSBackgroundColor"]];
|
||||
|
||||
var headerViewHeight = [theme valueForAttributeWithName:@"header-view-height" forClass:CPTableView];
|
||||
|
||||
if (!headerViewHeight)
|
||||
headerViewHeight = [self currentValueForThemeAttribute:@"header-view-height"];
|
||||
|
||||
[_headerView _setHeightIfDefaultValue:headerViewHeight];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
Reference in New Issue
Block a user