From 7f764065e4d7a0801ecf13741054c6e7fa1e71eb Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 26 Aug 2009 16:30:24 +0000 Subject: [Author: thomasvl] Add an api for autosizing TextFields but keeping the width fixed. This needs a test in the future, but need it at the moment for chrome. R=stuartmorgan DELTA=18 (17 added, 1 deleted, 0 changed) --- AppKit/GTMUILocalizerAndLayoutTweaker.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'AppKit/GTMUILocalizerAndLayoutTweaker.h') diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.h b/AppKit/GTMUILocalizerAndLayoutTweaker.h index 2d6e0a4..6562243 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.h +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.h @@ -17,6 +17,7 @@ // #import +#import "GTMDefines.h" @class GTMUILocalizer; @@ -38,6 +39,13 @@ // where sizeToFit doesn't product a view that meets UI guidelines. // Returns the amount the view changed in size. + (NSSize)sizeToFitView:(NSView *)view; + +// If you call sizeToFit on a NSTextField it will try not to word wrap, so it +// can get really wide. This method will keep the width fixed, but figure out +// how tall the textfield needs to be to fit its text. +// Returns the amount the field changed height. ++ (NSUInteger)sizeToFitFixedWidthTextField:(NSTextField *)textField; + @end // This is a Tweaker that will call sizeToFit on everything within it (that -- cgit v1.2.3