mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-21 09:50:41 +00:00
Fix for ouline column disclosure button staying in place while resizing
This commit is contained in:
@@ -766,6 +766,54 @@ CPOutlineViewDropOnItemIndex = -1;
|
||||
return rect;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
We need to move the disclosure control too
|
||||
*/
|
||||
- (void)_layoutDataViewsInRows:(CPIndexSet)rows columns:(CPIndexSet)columns
|
||||
{
|
||||
var rowArray = [],
|
||||
columnArray = [];
|
||||
|
||||
[rows getIndexes:rowArray maxCount:-1 inIndexRange:nil];
|
||||
[columns getIndexes:columnArray maxCount:-1 inIndexRange:nil];
|
||||
|
||||
var columnIndex = 0,
|
||||
columnsCount = columnArray.length;
|
||||
|
||||
for (; columnIndex < columnsCount; ++columnIndex)
|
||||
{
|
||||
var column = columnArray[columnIndex],
|
||||
tableColumn = _tableColumns[column],
|
||||
tableColumnUID = [tableColumn UID],
|
||||
dataViewsForTableColumn = _dataViewsForTableColumns[tableColumnUID],
|
||||
columnRange = _tableColumnRanges[column],
|
||||
rowIndex = 0,
|
||||
rowsCount = rowArray.length;
|
||||
|
||||
for (; rowIndex < rowsCount; ++rowIndex)
|
||||
{
|
||||
var row = rowArray[rowIndex],
|
||||
dataView = dataViewsForTableColumn[row],
|
||||
dataViewFrame = [self frameOfDataViewAtColumn:column row:row];
|
||||
|
||||
[dataView setFrame:dataViewFrame];
|
||||
|
||||
if (tableColumn === _outlineTableColumn)
|
||||
{
|
||||
console.log("bam");
|
||||
var control = _disclosureControlsForRows[row],
|
||||
frame = [control frame];
|
||||
if (frame)
|
||||
{
|
||||
frame.origin.x = _indentationMarkerFollowsDataView ? _CGRectGetMinX(dataViewFrame) - _CGRectGetWidth(frame) : 0.0;
|
||||
[control setFrame:frame];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_loadDataViewsInRows:(CPIndexSet)rows columns:(CPIndexSet)columns
|
||||
{
|
||||
[super _loadDataViewsInRows:rows columns:columns];
|
||||
|
||||
@@ -151,37 +151,27 @@ CustomOutlineViewDragType = @"CustomOutlineViewDragType";
|
||||
[Menu menuWithTitle:@"1.2.3"]
|
||||
]]
|
||||
]],
|
||||
// [Menu menuWithTitle:@"2" children:[
|
||||
// [Menu menuWithTitle:@"2.1" children:[
|
||||
// [Menu menuWithTitle:@"2.1.1"],
|
||||
// [Menu menuWithTitle:@"2.1.2"],
|
||||
// [Menu menuWithTitle:@"2.1.3"],
|
||||
// ]],
|
||||
// [Menu menuWithTitle:@"2.2" children:[
|
||||
// [Menu menuWithTitle:@"2.2.1"],
|
||||
// [Menu menuWithTitle:@"2.2.2"],
|
||||
// ]]
|
||||
// ]],
|
||||
// [Menu menuWithTitle:@"3" children:[
|
||||
// [Menu menuWithTitle:@"3.1" children:[
|
||||
// [Menu menuWithTitle:@"3.1.1"],
|
||||
// [Menu menuWithTitle:@"3.1.2"],
|
||||
// [Menu menuWithTitle:@"3.1.3"],
|
||||
// ]],
|
||||
// [Menu menuWithTitle:@"3.2" children:[
|
||||
// [Menu menuWithTitle:@"3.2.1"],
|
||||
// [Menu menuWithTitle:@"3.2.2"],
|
||||
// [Menu menuWithTitle:@"3.2.3"],
|
||||
// [Menu menuWithTitle:@"3.2.4"],
|
||||
// ]],
|
||||
// [Menu menuWithTitle:@"3.3" children:[
|
||||
// [Menu menuWithTitle:@"3.3.1"],
|
||||
// [Menu menuWithTitle:@"3.3.2"],
|
||||
// [Menu menuWithTitle:@"3.3.3"],
|
||||
// [Menu menuWithTitle:@"3.3.4"],
|
||||
// [Menu menuWithTitle:@"3.3.5"],
|
||||
// ]]
|
||||
// ]]
|
||||
[Menu menuWithTitle:@"2" children:nil],
|
||||
[Menu menuWithTitle:@"3" children:[
|
||||
[Menu menuWithTitle:@"3.1" children:[
|
||||
[Menu menuWithTitle:@"3.1.1"],
|
||||
[Menu menuWithTitle:@"3.1.2"],
|
||||
[Menu menuWithTitle:@"3.1.3"],
|
||||
]],
|
||||
[Menu menuWithTitle:@"3.2" children:[
|
||||
[Menu menuWithTitle:@"3.2.1"],
|
||||
[Menu menuWithTitle:@"3.2.2"],
|
||||
[Menu menuWithTitle:@"3.2.3"],
|
||||
[Menu menuWithTitle:@"3.2.4"],
|
||||
]],
|
||||
[Menu menuWithTitle:@"3.3" children:[
|
||||
[Menu menuWithTitle:@"3.3.1"],
|
||||
[Menu menuWithTitle:@"3.3.2"],
|
||||
[Menu menuWithTitle:@"3.3.3"],
|
||||
[Menu menuWithTitle:@"3.3.4"],
|
||||
[Menu menuWithTitle:@"3.3.5"],
|
||||
]]
|
||||
]]
|
||||
]];
|
||||
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:[contentView bounds]];
|
||||
@@ -191,8 +181,12 @@ CustomOutlineViewDragType = @"CustomOutlineViewDragType";
|
||||
var column = [[CPTableColumn alloc] initWithIdentifier:@"One"];
|
||||
[_outlineView addTableColumn:column];
|
||||
[_outlineView setOutlineTableColumn:column];
|
||||
setTimeout(function(){
|
||||
[column setWidth:200];
|
||||
},0);
|
||||
|
||||
[_outlineView addTableColumn:[[CPTableColumn alloc] initWithIdentifier:@"Two"]];
|
||||
[_outlineView addTableColumn:[[CPTableColumn alloc] initWithIdentifier:@"Three"]];
|
||||
|
||||
[_outlineView registerForDraggedTypes:[CustomOutlineViewDragType]];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user