Revision: 7638
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7638&view=rev
Author:   hofman
Date:     2012-02-12 21:35:29 +0000 (Sun, 12 Feb 2012)
Log Message:
-----------
adjust expansion frame for vertically centered text field cell

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

Modified: trunk/SKCenteredTextFieldCell.m
===================================================================
--- trunk/SKCenteredTextFieldCell.m     2012-02-12 18:51:56 UTC (rev 7637)
+++ trunk/SKCenteredTextFieldCell.m     2012-02-12 21:35:29 UTC (rev 7638)
@@ -42,14 +42,22 @@
 
 @implementation SKCenteredTextFieldCell
 
-- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+- (NSRect)centeredFrame:(NSRect)cellFrame inView:(NSView *)view {
     CGFloat height = [self cellSizeForBounds:cellFrame].height;
     if (height < NSHeight(cellFrame)) {
         cellFrame.origin.y += floor(0.5 * (NSHeight(cellFrame) - height));
-        cellFrame.origin.y += [controlView isFlipped] ? TEXT_OFFSET : 
-TEXT_OFFSET;
+        cellFrame.origin.y += [view isFlipped] ? TEXT_OFFSET : -TEXT_OFFSET;
         cellFrame.size.height = height;
     }
-    [super drawInteriorWithFrame:cellFrame inView:controlView];
+    return cellFrame;
 }
 
+- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+    [super drawInteriorWithFrame:[self centeredFrame:cellFrame 
inView:controlView] inView:controlView];
+}
+
+- (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView *)view {
+    return [super expansionFrameWithFrame:[self centeredFrame:cellFrame 
inView:view] inView:view];
+}
+
 @end

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


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to