From b9095b217618436b8bac853a5cdfeb946fca0e17 Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Tue, 2 Nov 2010 13:02:24 +0100 Subject: [PATCH 1/2] box is now resized using CPViewHeightSizable --- AppKit/CPTabView.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTabView.j b/AppKit/CPTabView.j index 383112a6d..8e7a1f3e4 100644 --- a/AppKit/CPTabView.j +++ b/AppKit/CPTabView.j @@ -74,7 +74,7 @@ var HEIGHT_OF_SEGMENTED_CONTROL = 24; [self addSubview:box]; [self addSubview:tabs]; - [box setAutoresizingMask:CPViewWidthSizable]; + [box setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; [tabs setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin]; } return self; From 9a4c9e4306ad27ff5b6bdbbe180e9db08d5822c6 Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Thu, 4 Nov 2010 10:41:24 +0100 Subject: [PATCH 2/2] add test for CPTabView height resizing --- Tests/AppKit/CPTabViewTest.j | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tests/AppKit/CPTabViewTest.j b/Tests/AppKit/CPTabViewTest.j index 9bba62b40..7aa96e510 100644 --- a/Tests/AppKit/CPTabViewTest.j +++ b/Tests/AppKit/CPTabViewTest.j @@ -10,6 +10,11 @@ return tabs; } +- (CPBox)box +{ + return box; +} + @end @@ -62,4 +67,14 @@ [self assert:([tabs boundsSize].width / 2) equals:CPRectGetMidX([tabs bounds])]; } +- (void)testBoxHeight +{ + var box = [_tabView box], + tabs = [_tabView tabs]; + + [_tabView setFrame:CPRectMake(0, 0, 800, 800)]; + [self assert:[box frameSize].height equals:800 - ([box frameOrigin].y) - [tabs frameSize].height / 2]; +} + + @end \ No newline at end of file