Revision: 12988
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12988&view=rev
Author: hofman
Date: 2008-03-06 13:53:10 -0800 (Thu, 06 Mar 2008)
Log Message:
-----------
Restrict slider width.
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m 2008-03-06
20:23:42 UTC (rev 12987)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m 2008-03-06
21:53:10 UTC (rev 12988)
@@ -468,14 +468,24 @@
return _sliderWindow;
}
+#define MIN_SLIDER_WIDTH 50.0
+#define MAX_SLIDER_WIDTH 200.0
+#define SLIDER_HEIGHT 15.0
+
- (NSRect)_topSliderRect
{
NSRect r = [self visibleRect];
- CGFloat l = floor(NSWidth(r) / 3);
+#if __LP64__
+ CGFloat w = fmax( MAX_SLIDER_WIDTH, fmin( MIN_SLIDER_WIDTH, NSWidth(r) /
3.0 ) );
+ CGFloat l = fmax( 0.0, floor( ( NSWidth(r) - w ) / 2.0 ) );
+#else
+ CGFloat w = fmaxf( MAX_SLIDER_WIDTH, fminf( MIN_SLIDER_WIDTH, NSWidth(r) /
3.0 ) );
+ CGFloat l = fmaxf( 0.0, floorf( ( NSWidth(r) - w ) / 2.0 ) );
+#endif
r.origin.x += l;
- r.origin.y += 1;
- r.size.width -= 2 * l;
- r.size.height = 15;
+ r.origin.y += 1.0;
+ r.size.width -= 2.0 * l;
+ r.size.height = SLIDER_HEIGHT;
return r;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit