From 0ad6a06b880fa094724e13103a03fbdaae6dd397 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 8 Feb 2010 19:04:28 +0000 Subject: [Author: thomasvl] Add basic support for NSTabView and a unittest to validate simple behaviors. R=dmaclach DELTA=1069 (1066 added, 0 deleted, 3 changed) --- AppKit/GTMUILocalizerAndLayoutTweaker.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'AppKit/GTMUILocalizerAndLayoutTweaker.m') diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.m b/AppKit/GTMUILocalizerAndLayoutTweaker.m index a2f94ab..94bb637 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.m +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.m @@ -123,9 +123,19 @@ static BOOL IsRightAnchored(NSView *view); } - (void)tweakView:(NSView *)view { - // If its a alignment box, let it do its thing, otherwise, go find boxes + // If it's a alignment box, let it do its thing... if ([view isKindOfClass:[GTMWidthBasedTweaker class]]) { [(GTMWidthBasedTweaker *)view tweakLayoutWithOffset:NSZeroPoint]; + // Do our best to support TabViews. If the tabs need to resize, you are + // probably better off manually running them through a tweaker and then fixing + // up the parent view (and other tabs) to look right. + } else if ([view isKindOfClass:[NSTabView class]]) { + NSArray *tabViewItems = [(NSTabView *)view tabViewItems]; + NSTabViewItem *item = nil; + GTM_FOREACH_OBJECT(item, tabViewItems) { + [self tweakView:[item view]]; + } + // Generically look for subviews... } else { NSArray *subviews = [view subviews]; NSView *subview = nil; -- cgit v1.2.3