diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-08-28 17:15:28 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-08-28 17:15:28 +0000 |
commit | 688c8010fe873634d2a1d4ec964924f2de2a02cc (patch) | |
tree | 8c4b2f7729c28a31085d0629cf8c2e6d10d891cc /AppKit | |
parent | d300ff3f52ba4b56f8e71aaa4b41dd03d58a5ca6 (diff) |
[Author: thomasvl]
Comment on one of the public UI points.
Put in another public UI point for tweaking UI without doing the
localization step (for non localization content tweaking).
R=stuartmorgan
DELTA=12 (11 added, 0 deleted, 1 changed)
Diffstat (limited to 'AppKit')
-rw-r--r-- | AppKit/GTMUILocalizerAndLayoutTweaker.h | 6 | ||||
-rw-r--r-- | AppKit/GTMUILocalizerAndLayoutTweaker.m | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.h b/AppKit/GTMUILocalizerAndLayoutTweaker.h index 2244cfe..0ef0763 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.h +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.h @@ -31,9 +31,15 @@ IBOutlet GTMUILocalizer *localizer_; // If nil, one will be created IBOutlet id localizerOwner_; // Set if you want the default GTMUILocalizer } +// Localize the the UI and then tweak the layout in the given object. - (void)applyLocalizer:(GTMUILocalizer *)localizer tweakingUI:(id)uiObject; +// Don't do any localization, just runs the tweaks, useful if you just need +// layout adjusted based on content from elsewhere. |uiObject| should be +// a NSWindow or NSView (or subclass). +- (void)tweakUI:(id)uiObject; + // This checks to see if |view| implements @selector(sizeToFit) and calls it. // It then checks the class of |view| and does some fixup for known issues // where sizeToFit doesn't product a view that meets UI guidelines. diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.m b/AppKit/GTMUILocalizerAndLayoutTweaker.m index 1b5d8aa..b8c6499 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.m +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.m @@ -59,6 +59,11 @@ static BOOL IsRightAnchored(NSView *view); // Localize first [localizer localizeObject:uiObject recursively:YES]; + // Then tweak! + [self tweakUI:uiObject]; +} + +- (void)tweakUI:(id)uiObject { // Figure out where we start NSView *startView; if ([uiObject isKindOfClass:[NSWindow class]]) { @@ -68,8 +73,8 @@ static BOOL IsRightAnchored(NSView *view); @"should have been a subclass of NSView"); startView = (NSView *)uiObject; } - - // And Tweak! + + // Tweak away! [self tweakView:startView]; } |