Commits

Juri Pakaste committed 8c44264

Added Daniel Jalkut's RSVerticallyCenteredTextFieldCell to the project and changed the path text cell used in the modified files list to use it instead of NSTextFieldCell to get the cell contents vertically aligned with the icons.

Comments (0)

Files changed (6)

English.lproj/Repo.xib

 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="300421"/>
+			<integer value="300089"/>
 			<integer value="300061"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 								<string key="NSToolbarItemPaletteLabel">Commit All</string>
 								<string key="NSToolbarItemToolTip">Commits changes to all files.</string>
 								<nil key="NSToolbarItemView"/>
-								<object class="NSCustomResource" key="NSToolbarItemImage" id="230019408">
+								<object class="NSCustomResource" key="NSToolbarItemImage" id="1048289166">
 									<string key="NSClassName">NSImage</string>
 									<string key="NSResourceName">toolbar_commitall</string>
 								</object>
 								<reference key="NSTextColor" ref="306507377"/>
 							</object>
 						</object>
-						<object class="NSImageView" id="1027594338">
+						<object class="NSImageView" id="616266716">
 							<reference key="NSNextResponder" ref="601455988"/>
 							<int key="NSvFlags">268</int>
 							<object class="NSMutableSet" key="NSDragTypes">
 							<string key="NSFrame">{{20, 184}, {32, 32}}</string>
 							<reference key="NSSuperview" ref="601455988"/>
 							<bool key="NSEnabled">YES</bool>
-							<object class="NSImageCell" key="NSCell" id="860831933">
+							<object class="NSImageCell" key="NSCell" id="520348222">
 								<int key="NSCellFlags">130560</int>
 								<int key="NSCellFlags2">33554432</int>
-								<reference key="NSContents" ref="230019408"/>
+								<reference key="NSContents" ref="1048289166"/>
 								<int key="NSAlign">0</int>
 								<int key="NSScale">0</int>
 								<int key="NSStyle">0</int>
 					<object class="IBOutletConnection" key="connection">
 						<string key="label">_commitIconView</string>
 						<reference key="source" ref="798535885"/>
-						<reference key="destination" ref="1027594338"/>
+						<reference key="destination" ref="616266716"/>
 					</object>
 					<int key="connectionID">300429</int>
 				</object>
 							<reference ref="999697967"/>
 							<reference ref="912248093"/>
 							<reference ref="895980691"/>
-							<reference ref="1027594338"/>
+							<reference ref="616266716"/>
 							<reference ref="759674735"/>
 						</object>
 						<reference key="parent" ref="519367524"/>
 					</object>
 					<object class="IBObjectRecord">
 						<int key="objectID">300427</int>
-						<reference key="object" ref="1027594338"/>
+						<reference key="object" ref="616266716"/>
 						<object class="NSMutableArray" key="children">
 							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="860831933"/>
+							<reference ref="520348222"/>
 						</object>
 						<reference key="parent" ref="601455988"/>
 					</object>
 					<object class="IBObjectRecord">
 						<int key="objectID">300428</int>
-						<reference key="object" ref="860831933"/>
-						<reference key="parent" ref="1027594338"/>
+						<reference key="object" ref="520348222"/>
+						<reference key="parent" ref="616266716"/>
 					</object>
 				</object>
 			</object>
 					<string>300085.IBPluginDependency</string>
 					<string>300086.IBPluginDependency</string>
 					<string>300089.IBPluginDependency</string>
+					<string>300090.CustomClassName</string>
 					<string>300090.IBPluginDependency</string>
 					<string>300093.IBEditorWindowLastContentRect</string>
 					<string>300093.IBPluginDependency</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>RSVerticallyCenteredTextFieldCell</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{420, 1025}, {616, 0}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">RSVerticallyCenteredTextFieldCell</string>
+					<string key="superclassName">NSTextFieldCell</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Source/RSVerticallyCenteredTextFieldCell.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">RepoController</string>
 					<string key="superclassName">NSWindowController</string>
 					<object class="NSMutableDictionary" key="actions">
     "English.lproj/MainMenu.xib": "07985267460a39d475e4c96145dab97e", 
     "German.lproj/Projects.strings": "8554bdd35568c0d598d3f5b322836067", 
     "German.lproj/Repo.strings": "8bb4aeacd068f7b82e02806076095383", 
-    "English.lproj/Repo.xib": "b14353add4b6a70cfdb736af5e06ef4d", 
+    "English.lproj/Repo.xib": "b331757eac2d05adfc69e57b36d19e17", 
     "German.lproj/MainMenu.strings": "aa69dae50fd262857497ba56606ac537"
 }

Murky.xcodeproj/project.pbxproj

 		73CA81FA10135B360081F0D8 /* toolbar_terminal.png in Resources */ = {isa = PBXBuildFile; fileRef = 73CA81F910135B360081F0D8 /* toolbar_terminal.png */; };
 		73CA82D710135FC10081F0D8 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73CA82D610135FC10081F0D8 /* ScriptingBridge.framework */; };
 		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+		CB8C0ABD112FD4FC0035B752 /* RSVerticallyCenteredTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CB8C0ABC112FD4FC0035B752 /* RSVerticallyCenteredTextFieldCell.m */; };
+		CB8C0AC5112FD57A0035B752 /* RSVerticallyCenteredTextFieldCell MIT-License.rtf in Resources */ = {isa = PBXBuildFile; fileRef = CB8C0AC4112FD57A0035B752 /* RSVerticallyCenteredTextFieldCell MIT-License.rtf */; };
 		D095A4110FBC0FD800512681 /* toolbar_discard.png in Resources */ = {isa = PBXBuildFile; fileRef = D095A40F0FBC0FD800512681 /* toolbar_discard.png */; };
 		D095A4120FBC0FD800512681 /* toolbar_refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = D095A4100FBC0FD800512681 /* toolbar_refresh.png */; };
 		D095A4920FBC26A200512681 /* status_test.png in Resources */ = {isa = PBXBuildFile; fileRef = D095A4910FBC26A200512681 /* status_test.png */; };
 		73CA82D610135FC10081F0D8 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = "<absolute>"; };
 		8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		8D1107320486CEB800E47090 /* Murky.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Murky.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		CB8C0ABB112FD4FC0035B752 /* RSVerticallyCenteredTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSVerticallyCenteredTextFieldCell.h; sourceTree = "<group>"; };
+		CB8C0ABC112FD4FC0035B752 /* RSVerticallyCenteredTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSVerticallyCenteredTextFieldCell.m; sourceTree = "<group>"; };
+		CB8C0AC4112FD57A0035B752 /* RSVerticallyCenteredTextFieldCell MIT-License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "RSVerticallyCenteredTextFieldCell MIT-License.rtf"; sourceTree = "<group>"; };
 		D095A40F0FBC0FD800512681 /* toolbar_discard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = toolbar_discard.png; path = Resources/Icons/toolbar_discard.png; sourceTree = SOURCE_ROOT; };
 		D095A4100FBC0FD800512681 /* toolbar_refresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = toolbar_refresh.png; path = Resources/Icons/toolbar_refresh.png; sourceTree = SOURCE_ROOT; };
 		D095A4910FBC26A200512681 /* status_test.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = status_test.png; path = Resources/Icons/status_test.png; sourceTree = SOURCE_ROOT; };
 				277C50910C55BCB800E60690 /* MercurialApp.h */,
 				277C50920C55BCB800E60690 /* MercurialApp.m */,
 				27C657A70FAEA82300CFB909 /* MainMenu.xib */,
+				CB8C0ABB112FD4FC0035B752 /* RSVerticallyCenteredTextFieldCell.h */,
+				CB8C0ABC112FD4FC0035B752 /* RSVerticallyCenteredTextFieldCell.m */,
 			);
 			name = "User Interface";
 			path = Source;
 				2712F05C0C5823BF00E36E41 /* Support */,
 				29B97317FDCFA39411CA2CEA /* Resources */,
 				27AA81A50FADF53100D4FCBB /* README.txt */,
+				CB8C0AC4112FD57A0035B752 /* RSVerticallyCenteredTextFieldCell MIT-License.rtf */,
 				29B97323FDCFA39411CA2CEA /* Frameworks */,
 				19C28FACFE9D520D11CA2CBB /* Products */,
 			);
 				7300A4FB10DA29E2009C0BE4 /* toolbar_tag.png in Resources */,
 				27E396FA10E88314009F99ED /* Localizable.strings in Resources */,
 				73ACF87910F715E4003304B2 /* no_file.png in Resources */,
+				CB8C0AC5112FD57A0035B752 /* RSVerticallyCenteredTextFieldCell MIT-License.rtf in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 				27E772930FB09EA7006504EF /* MYWindowUtils.m in Sources */,
 				27C1C936104EF9F400781C99 /* SourceHighlighting.m in Sources */,
 				7341D0BF10F470E000076123 /* IconTextCell.m in Sources */,
+				CB8C0ABD112FD4FC0035B752 /* RSVerticallyCenteredTextFieldCell.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

RSVerticallyCenteredTextFieldCell MIT-License.rtf

Binary file added.
+{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380
+{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+{\info
+{\*\company Test}}\margl1440\margr1440\vieww9000\viewh8400\viewkind0
+\deftab720
+\pard\pardeftab720\sl380\ql\qnatural
+
+\f0\fs25\fsmilli12700 \cf0 This source code is provided to you compliments of Red Sweater Software under the license as described below. NOTE: This is the MIT License.\
+\
+Copyright (c) 2006 Red Sweater Software\
+\
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\
+\
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\
+\
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\
+}

Source/RSVerticallyCenteredTextFieldCell.h

+//
+//  RSVerticallyCenteredTextFieldCell.h
+//  RSCommon
+//
+//  Created by Daniel Jalkut on 6/17/06.
+//  Copyright 2006 Red Sweater Software. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface RSVerticallyCenteredTextFieldCell : NSTextFieldCell
+{
+	BOOL mIsEditingOrSelecting;
+}
+
+@end

Source/RSVerticallyCenteredTextFieldCell.m

+//
+//  RSVerticallyCenteredTextField.m
+//  RSCommon
+//
+//  Created by Daniel Jalkut on 6/17/06.
+//  Copyright 2006 Red Sweater Software. All rights reserved.
+//
+
+#import "RSVerticallyCenteredTextFieldCell.h"
+
+@implementation RSVerticallyCenteredTextFieldCell
+
+- (NSRect)drawingRectForBounds:(NSRect)theRect
+{
+	// Get the parent's idea of where we should draw
+	NSRect newRect = [super drawingRectForBounds:theRect];
+
+	// When the text field is being 
+	// edited or selected, we have to turn off the magic because it screws up 
+	// the configuration of the field editor.  We sneak around this by 
+	// intercepting selectWithFrame and editWithFrame and sneaking a 
+	// reduced, centered rect in at the last minute.
+	if (mIsEditingOrSelecting == NO)
+	{
+		// Get our ideal size for current text
+		NSSize textSize = [self cellSizeForBounds:theRect];
+
+		// Center that in the proposed rect
+		float heightDelta = newRect.size.height - textSize.height;	
+		if (heightDelta > 0)
+		{
+			newRect.size.height -= heightDelta;
+			newRect.origin.y += (heightDelta / 2);
+		}
+	}
+	
+	return newRect;
+}
+
+- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart length:(int)selLength
+{
+	aRect = [self drawingRectForBounds:aRect];
+	mIsEditingOrSelecting = YES;	
+	[super selectWithFrame:aRect inView:controlView editor:textObj delegate:anObject start:selStart length:selLength];
+	mIsEditingOrSelecting = NO;
+}
+
+- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent
+{	
+	aRect = [self drawingRectForBounds:aRect];
+	mIsEditingOrSelecting = YES;
+	[super editWithFrame:aRect inView:controlView editor:textObj delegate:anObject event:theEvent];
+	mIsEditingOrSelecting = NO;
+}
+
+@end