From e5ea6b242de0a92b21d973de7594e2a8922e446b Mon Sep 17 00:00:00 2001 From: Francisco Tolmasky Date: Sun, 22 Mar 2009 12:40:06 -0700 Subject: [PATCH] Fixed Aristo affecting unbordered pop up buttons. Reviewed by me. --- AppKit/CPButton.j | 10 +++++----- AppKit/Themes/Aristo/ThemeDescriptors.j | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index 77154e3b5..b3aa3e845 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -472,9 +472,9 @@ var _CPButtonClassName = nil, { var contentInset = [self currentValueForThemedAttributeName:@"content-inset"]; - if (!contentInset) + if (_CGInsetIsEmpty(contentInset)) return bounds; - + bounds.origin.x += contentInset.left; bounds.origin.y += contentInset.top; bounds.size.width -= contentInset.left + contentInset.right; @@ -489,8 +489,8 @@ var _CPButtonClassName = nil, return _CGRectMakeZero(); var bezelInset = [self currentValueForThemedAttributeName:@"bezel-inset"]; - - if (!_CGInsetIsEmpty(bezelInset)) + + if (_CGInsetIsEmpty(bezelInset)) return bounds; bounds.origin.x += bezelInset.left; @@ -540,7 +540,7 @@ var _CPButtonClassName = nil, var contentView = [self layoutEphemeralSubviewNamed:@"content-view" positioned:CPWindowAbove relativeToEphemeralSubviewNamed:@"bezel-view"]; - + if (contentView) { [contentView setText:((_controlState & CPControlStateHighlighted) && _alternateTitle) ? _alternateTitle : _title]; diff --git a/AppKit/Themes/Aristo/ThemeDescriptors.j b/AppKit/Themes/Aristo/ThemeDescriptors.j index 95d365808..120caf556 100644 --- a/AppKit/Themes/Aristo/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo/ThemeDescriptors.j @@ -212,8 +212,8 @@ [button setTitle:@"Pop Up"]; - [button setValue:color forThemedAttributeName:@"bezel-color"]; - [button setValue:CGInsetMake(0, 5, 0, 27.0 + 5.0) forThemedAttributeName:@"content-inset"]; + [button setValue:color forThemedAttributeName:@"bezel-color" inControlState:CPControlStateBordered]; + [button setValue:CGInsetMake(0, 5, 0, 27.0 + 5.0) forThemedAttributeName:@"content-inset" inControlState:CPControlStateBordered]; [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemedAttributeName:@"font"]; [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemedAttributeName:@"text-color"]; [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemedAttributeName:@"text-shadow-color"]; @@ -237,8 +237,8 @@ [button setTitle:@"Pop Up"]; - [button setValue:color forThemedAttributeName:@"bezel-color" inControlState:CPPopUpButtonStatePullsDown]; - [button setValue:CGInsetMake(0, 5, 0, 27.0 + 5.0) forThemedAttributeName:@"content-inset"]; + [button setValue:color forThemedAttributeName:@"bezel-color" inControlState:CPPopUpButtonStatePullsDown|CPControlStateBordered]; + [button setValue:CGInsetMake(0, 5, 0, 27.0 + 5.0) forThemedAttributeName:@"content-inset" inControlState:CPControlStateBordered]; [button setValue:[CPFont boldSystemFontOfSize:12.0] forThemedAttributeName:@"font"]; [button setValue:[CPColor colorWithCalibratedWhite:79.0 / 255.0 alpha:1.0] forThemedAttributeName:@"text-color"]; [button setValue:[CPColor colorWithCalibratedWhite:240.0 / 255.0 alpha:1.0] forThemedAttributeName:@"text-shadow-color"];