mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-27 18:38:49 +00:00
Fix for incorrectly sized header views
This commit is contained in:
1 parent
e97b78477b
commit
ac6c03f2c7
4 files changed
+27
-17
No files matched your search
@@ -176,11 +176,12 @@
|
||||
// [_verticalScroller setEnabled:NO];
|
||||
// [_horizontalScroller setEnabled:NO];
|
||||
}
|
||||
|
||||
|
||||
[_contentView setFrame:[self clipViewFrame]];
|
||||
|
||||
[_headerClipView setFrame:[self headerClipViewFrame]];
|
||||
|
||||
--_recursionCount;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+14
-10
@@ -94,21 +94,25 @@
|
||||
return bounds;
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)aRect
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
var tableColumns = [_tableView tableColumns];
|
||||
var count = [tableColumns count];
|
||||
var columnRect = [self bounds];
|
||||
var spacing = [_tableView intercellSpacing];
|
||||
var tableColumns = [_tableView tableColumns],
|
||||
count = [tableColumns count],
|
||||
columnRect = [self bounds],
|
||||
spacing = [_tableView intercellSpacing];
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
var column = [tableColumns objectAtIndex:i];
|
||||
var headerView = [column headerView] ;
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
var column = [tableColumns objectAtIndex:i],
|
||||
headerView = [column headerView];
|
||||
|
||||
columnRect.size.width = [column width] + spacing.width;
|
||||
// [headerView setHighlighted:[_tableView isColumnSelected:[[_tableView tableColumns] indexOfObject:column]]];
|
||||
|
||||
[headerView setFrame:columnRect];
|
||||
|
||||
columnRect.origin.x += [column width] + spacing.width;
|
||||
[self addSubview:headerView] ;
|
||||
|
||||
[self addSubview:headerView];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,6 @@ CPTableViewSelectionHighlightStyleSourceList = 1;
|
||||
_rowHeight = 24.0;
|
||||
|
||||
_headerView = [[CPTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, [self bounds].size.width, _rowHeight)];
|
||||
[_headerView setAutoresizingMask:CPViewWidthSizable];
|
||||
|
||||
[_headerView setTableView:self];
|
||||
|
||||
@@ -1117,6 +1116,12 @@ _cachedDataViews[dataView.identifier].push(dataView);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setFrameSize:(CGSize)aSize
|
||||
{
|
||||
[super setFrameSize:aSize];
|
||||
[_headerView setFrameSize:CGSizeMake(aSize.width, [_headerView frame].size.height)];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[self load];
|
||||
|
||||
@@ -48,15 +48,15 @@ CPLogRegister(CPLogConsole);
|
||||
|
||||
[[column headerView] setStringValue:"Number "+i];
|
||||
[[column headerView] sizeToFit];
|
||||
[column setWidth:[[column headerView] frame].size.width + 20];
|
||||
//[column setWidth:[[column headerView] frame].size.width + 20];
|
||||
|
||||
//[column setWidth:200.0];
|
||||
[column setWidth:170.0];
|
||||
|
||||
[column setDataView:textDataView];
|
||||
|
||||
[tableView addTableColumn:column];
|
||||
}
|
||||
|
||||
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:[view bounds]];
|
||||
|
||||
[scrollView setDocumentView:tableView];
|
||||
|
||||
Reference in new issue
Block a user