From 89ad9ae8def4ada78f4affe1cbf9e0d8a734ac79 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Tue, 9 Aug 2011 17:00:31 +0000 Subject: [Author: rsesek] In GTM SizeToFit(), add more padding for NSTexturedRoundedBezelStyle buttons. R=thomasvl APPROVED=thomasvl --- AppKit/GTMUILocalizerAndLayoutTweaker.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'AppKit') diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.m b/AppKit/GTMUILocalizerAndLayoutTweaker.m index 5e19cd0..27a4649 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.m +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.m @@ -602,6 +602,12 @@ static NSSize SizeToFit(NSView *view, NSPoint offset) { if (NSWidth(newFrame) < kMinButtonWidth) { newFrame.size.width = kMinButtonWidth; } + } else if ([button bezelStyle] == NSTexturedRoundedBezelStyle && + [[button cell] controlSize] == NSRegularControlSize) { + // The round textured style needs to have a little extra padding, + // otherwise the baseline of the text sinks by a few pixels. + const CGFloat kExtraPaddingAmount = 4.0; + newFrame.size.width += kExtraPaddingAmount; } else { // See note on kWrapperStringSlop for why this is done. NSString *title = [button title]; -- cgit v1.2.3