|
@@ -414,6 +414,12 @@ NSPopoverDelegate>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ CGFloat buttonWidth = CGRectGetMaxX(self.button.frame);
|
|
|
+ NSRect btnRect = [self.button.attributedTitle boundingRectWithSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(self.button.frame)) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
|
|
|
+ if (fabs(buttonWidth-btnRect.size.width)>50) {
|
|
|
+ buttonWidth = btnRect.size.width + 10;
|
|
|
+ }
|
|
|
+
|
|
|
self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
|
|
|
CGRect rect = self.button.frame;
|
|
|
self.bgImg.frame = rect;
|