mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
fix small bugs in CPTabView
This commit is contained in:
+6
-3
@@ -49,7 +49,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1,
|
||||
{
|
||||
_tabs = [[CPSegmentedControl alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
|
||||
[_tabs setHitTests:NO];
|
||||
|
||||
|
||||
var height = [_tabs valueForThemeAttribute:@"default-height"];
|
||||
[_tabs setFrameSize:CGSizeMake(0, height)];
|
||||
|
||||
@@ -99,9 +99,9 @@ var CPTabViewDidSelectTabViewItemSelector = 1,
|
||||
var count = [_items count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if ([items objectAtIndex:i] === aTabViewItem)
|
||||
if ([_items objectAtIndex:i] === aTabViewItem)
|
||||
{
|
||||
[items removeObjectAtIndex:i];
|
||||
[_items removeObjectAtIndex:i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -149,6 +149,9 @@ var CPTabViewDidSelectTabViewItemSelector = 1,
|
||||
*/
|
||||
- (CPTabViewItem)tabViewItemAtIndex:(unsigned)anIndex
|
||||
{
|
||||
if (anIndex >= [_items count])
|
||||
return nil;
|
||||
|
||||
return [_items objectAtIndex:anIndex];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user