Revision: 7322
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7322&view=rev
Author:   hofman
Date:     2011-07-04 18:30:07 +0000 (Mon, 04 Jul 2011)

Log Message:
-----------
Add 12pt extra width to push buttons, as IB and NSAlert seem to do

Modified Paths:
--------------
    trunk/NSGeometry_SKExtensions.m

Modified: trunk/NSGeometry_SKExtensions.m
===================================================================
--- trunk/NSGeometry_SKExtensions.m     2011-07-04 17:58:23 UTC (rev 7321)
+++ trunk/NSGeometry_SKExtensions.m     2011-07-04 18:30:07 UTC (rev 7322)
@@ -114,6 +114,7 @@
 
 #define MIN_BUTTON_WIDTH 82.0
 #define MAX_BUTTON_WIDTH 100.0
+#define EXTRA_BUTTON_WIDTH 12.0
 
 void SKShiftAndResizeViews(NSArray *views, CGFloat dx, CGFloat dw) {
     for (NSView *view in views) {
@@ -132,12 +133,12 @@
     CGFloat width = 0.0;
     for (button in buttons) {
         [button sizeToFit];
-        width = fmax(width, NSWidth([button frame]));
+        width = fmax(width, NSWidth([button frame]) + EXTRA_BUTTON_WIDTH);
     }
     width = fmin(MAX_BUTTON_WIDTH, fmax(MIN_BUTTON_WIDTH, width));
     for (button in buttons) {
         NSRect frame = [button frame];
-        frame.size.width = fmax(width, NSWidth(frame));
+        frame.size.width = fmax(width, NSWidth(frame) + EXTRA_BUTTON_WIDTH);
         if (rightAlign) {
             x -= NSWidth(frame);
             frame.origin.x = x;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to