Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPButton sizeToFit with border

#43

the CPButton sizeToFit method doesn't work well when there is a border -- the height is wrong and the width doesn't adjust for the left/right images.

  • (void)sizeToFit { [_imageAndTitleView sizeToFit];

    var frame = [_imageAndTitleView frame],

    height = CGRectGetHeight(frame),
    width = CGRectGetWidth(frame),
    bezelSizes;
    
    
    if (_isBordered) {
    bezelSizes = _CPButtonBezelStyleSizes[_CPButtonClassName + _CPButtonBezelStyleIdentifiers[_bezelStyle]];
    height = bezelSizes [[1]](/projects/16499/changesets/1 "Changeset #1").height;
    width += bezelSizes [[0]](/projects/16499/changesets/0 "Changeset #0").width + bezelSizes [[2]](/projects/16499/changesets/2 "Changeset #2").width;
    
    

    }

    [self setFrameSize:CGSizeMake(width, height)]; }

Reported by Kelvin Sherlock · September 16th, 2008 @ 07:18 AM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. Ross Boucher
  2. Ross Boucher
    Ross Boucher
    • State changed from new to open
    • Milestone cleared.
    • Tag set to appkit

    September 29th, 2008 @ 10:17 AM

  3. admin (at 280north)
    admin (at 280north)
    • State changed from open to resolved
    • Tag changed from appkit to @acknowledged, appkit

    November 14th, 2009 @ 10:38 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.