Make default row height a theme attribute

This commit is contained in:
Antoine Mercadal committed 2013-01-09 20:24:27 -08:00
1 parent 4548696c73
commit b1ffd8d556
1 file changed
+7 -6
+7 -6
View File
@@ -260,8 +260,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
*/
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null]]
forKeys:["alternating-row-colors", "grid-color", "highlighted-grid-color", "selection-color", "sourcelist-selection-color", "sort-image", "sort-image-reversed", "selection-radius"]];
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], [CPNull null], 25.0]
forKeys:["alternating-row-colors", "grid-color", "highlighted-grid-color", "selection-color", "sourcelist-selection-color", "sort-image", "sort-image-reversed", "selection-radius", "default-row-height"]];
}
- (id)initWithFrame:(CGRect)aFrame
@@ -291,7 +291,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
_numberOfHiddenColumns = 0;
_intercellSpacing = _CGSizeMake(3.0, 2.0);
_rowHeight = 23.0;
_rowHeight = [self valueForThemeAttribute:@"default-row-height"];
[self setGridColor:[CPColor colorWithHexString:@"dce0e2"]];
[self setGridStyleMask:CPTableViewGridNone];
@@ -2864,7 +2864,8 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
{
var dragView = [[_CPColumnDragView alloc] initWithLineColor:[self gridColor]],
tableColumn = [[self tableColumns] objectAtIndex:theColumnIndex],
bounds = _CGRectMake(0.0, 0.0, [tableColumn width], _CGRectGetHeight([self exposedRect]) + 23.0),
defaultRowHeight = [self valueForThemeAttribute:@"default-row-height"],
bounds = _CGRectMake(0.0, 0.0, [tableColumn width], _CGRectGetHeight([self exposedRect]) + defaultRowHeight),
columnRect = [self rectOfColumn:theColumnIndex],
headerView = [tableColumn headerView],
row = [_exposedRows firstIndex];
@@ -2878,7 +2879,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
dataViewFrame.origin.x = 0.0;
// Offset by table header height - scroll position
dataViewFrame.origin.y = ( _CGRectGetMinY(dataViewFrame) - _CGRectGetMinY([self exposedRect]) ) + 23.0;
dataViewFrame.origin.y = ( _CGRectGetMinY(dataViewFrame) - _CGRectGetMinY([self exposedRect]) ) + defaultRowHeight;
[dataView setFrame:dataViewFrame];
[self _setObjectValueForTableColumn:tableColumn row:row forView:dataView];
@@ -4875,7 +4876,7 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey",
_tableColumns = [aCoder decodeObjectForKey:CPTableViewTableColumnsKey] || [];
[_tableColumns makeObjectsPerformSelector:@selector(setTableView:) withObject:self];
_rowHeight = [aCoder decodeFloatForKey:CPTableViewRowHeightKey] || 23.0;
_rowHeight = [aCoder decodeFloatForKey:CPTableViewRowHeightKey] || [self valueForThemeAttribute:@"default-row-height"];
_intercellSpacing = [aCoder decodeSizeForKey:CPTableViewIntercellSpacingKey];
if (_CGSizeEqualToSize(_intercellSpacing, _CGSizeMakeZero()))