diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2011-08-09 17:00:31 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2011-08-09 17:00:31 +0000 |
commit | 89ad9ae8def4ada78f4affe1cbf9e0d8a734ac79 (patch) | |
tree | d3281c2a6e2392462695660a269fdc849509aef0 /AppKit/GTMUILocalizerAndLayoutTweaker.m | |
parent | 3393cede4ab318e20d8549c72f93b9f8d7d3a41a (diff) |
[Author: rsesek]
In GTM SizeToFit(), add more padding for NSTexturedRoundedBezelStyle buttons.
R=thomasvl
APPROVED=thomasvl
Diffstat (limited to 'AppKit/GTMUILocalizerAndLayoutTweaker.m')
-rw-r--r-- | AppKit/GTMUILocalizerAndLayoutTweaker.m | 6 |
1 files changed, 6 insertions, 0 deletions
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]; |