aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMUILocalizerAndLayoutTweaker.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-02-08 19:04:28 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2010-02-08 19:04:28 +0000
commit0ad6a06b880fa094724e13103a03fbdaae6dd397 (patch)
treefdba5ebcf7612e7c4a33f96b6e0def169f795feb /AppKit/GTMUILocalizerAndLayoutTweaker.m
parentfbe9ecbdefae58a6ba0bb3f23a7a3d6c23ecfcf4 (diff)
[Author: thomasvl]
Add basic support for NSTabView and a unittest to validate simple behaviors. R=dmaclach DELTA=1069 (1066 added, 0 deleted, 3 changed)
Diffstat (limited to 'AppKit/GTMUILocalizerAndLayoutTweaker.m')
-rw-r--r--AppKit/GTMUILocalizerAndLayoutTweaker.m12
1 files changed, 11 insertions, 1 deletions
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;