mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-28 12:54:24 +01:00
Fix text field resizing for 10.5+ SDK
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@392 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
ebe77d7e3b
commit
ddd71b75f7
@ -112,9 +112,12 @@ NSString *const kDefaultServerType = @"google";
|
|||||||
@implementation NSTextField (ResizabilityExtentions)
|
@implementation NSTextField (ResizabilityExtentions)
|
||||||
- (float)breakpad_adjustHeightToFit {
|
- (float)breakpad_adjustHeightToFit {
|
||||||
NSRect oldFrame = [self frame];
|
NSRect oldFrame = [self frame];
|
||||||
|
// Starting with the 10.5 SDK, height won't grow, so make it huge to start.
|
||||||
|
NSRect presizeFrame = oldFrame;
|
||||||
|
presizeFrame.size.height = MAXFLOAT;
|
||||||
// sizeToFit will blow out the width rather than making the field taller, so
|
// sizeToFit will blow out the width rather than making the field taller, so
|
||||||
// we do it manually.
|
// we do it manually.
|
||||||
NSSize newSize = [[self cell] cellSizeForBounds:oldFrame];
|
NSSize newSize = [[self cell] cellSizeForBounds:presizeFrame];
|
||||||
NSRect newFrame = NSMakeRect(oldFrame.origin.x, oldFrame.origin.y,
|
NSRect newFrame = NSMakeRect(oldFrame.origin.x, oldFrame.origin.y,
|
||||||
NSWidth(oldFrame), newSize.height);
|
NSWidth(oldFrame), newSize.height);
|
||||||
[self setFrame:newFrame];
|
[self setFrame:newFrame];
|
||||||
|
Loading…
Reference in New Issue
Block a user