Commits

Tuukka Norri committed e264f00

Fixed drawing errors in table header views
- The invalid drawing mask wasn't really needed, so removed it.

Comments (0)

Files changed (5)

BaseTenAssistant/English.lproj/MainMenu.xib

 		<string key="IBDocument.HIToolboxVersion">352.00</string>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="456"/>
 			<integer value="629"/>
 			<integer value="712"/>
-			<integer value="469"/>
 			<integer value="558"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 					<string>454.ImportedFromIB2</string>
 					<string>456.IBPluginDependency</string>
 					<string>457.IBPluginDependency</string>
+					<string>458.CustomClassName</string>
 					<string>458.IBPluginDependency</string>
 					<string>459.IBPluginDependency</string>
 					<string>460.IBPluginDependency</string>
 					<string>464.IBPluginDependency</string>
 					<string>465.IBPluginDependency</string>
 					<string>466.IBPluginDependency</string>
+					<string>467.CustomClassName</string>
 					<string>467.IBPluginDependency</string>
 					<string>468.IBPluginDependency</string>
 					<string>469.CustomClassName</string>
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>MKCPolishedHeaderView</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>MKCPolishedHeaderView</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>MKCAlternativeDataCellColumn</string>
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">MKCPolishedHeaderView</string>
+					<string key="superclassName">NSTableHeaderView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">Source/MKCPolishedHeaderView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">MKCStackView</string>
 					<string key="superclassName">NSView</string>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">

BaseTenAssistant/Source/BXAController.m

 {
 	//Table headers
 	{
+		NSMutableDictionary* colours = [[MKCPolishedHeaderView darkColours] mutableCopy];
+		[colours setObject: [colours objectForKey: kMKCEnabledColoursKey] forKey: kMKCSelectedColoursKey];
+		
 		NSRect headerRect = NSMakeRect (0.0, 0.0, 0.0, 23.0);
 		headerRect.size.width = [mDBTableView bounds].size.width;
-		MKCPolishedHeaderView* headerView = [[[MKCPolishedHeaderView alloc] initWithFrame: headerRect] autorelease];
-		[headerView setColours: [MKCPolishedHeaderView darkColours]];
+		MKCPolishedHeaderView* headerView = (id) [mDBTableView headerView];
+		[headerView setFrame: headerRect];
+		[headerView setColours: colours];
 		[headerView setDrawingMask: kMKCPolishDrawBottomLine | 
 		 kMKCPolishDrawLeftAccent | kMKCPolishDrawTopAccent | kMKCPolishDrawSeparatorLines];
-		[mDBTableView setHeaderView: headerView];
 		
-		headerView = [[[MKCPolishedHeaderView alloc] initWithFrame: headerRect] autorelease];
+		headerView = (id) [mDBSchemaView headerView];
 		headerRect.size.width = [mDBSchemaView bounds].size.width;
+		[headerView setColours: colours];
+		[headerView setFrame: headerRect];
 		[headerView setDrawingMask: kMKCPolishDrawBottomLine | kMKCPolishDrawTopAccent];
-		[mDBSchemaView setHeaderView: headerView];
 	}
 	
 	//Table corners

BaseTenAssistant/Source/MKCPolishedCornerView.m

 {
     if ((self = [super initWithFrame: frame]))
     {
-        mDrawingMask = kMKCPolishDrawingMaskInvalid;
 		NSWindow* window = [self window];
 		NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
 		[nc addObserver: self selector: @selector (stateChanged:) name: NSApplicationDidBecomeActiveNotification object: NSApp];
 {
     if (nil == mColours)
         [self setColours: [MKCPolishedHeaderView darkColours]];
-    if (kMKCPolishDrawingMaskInvalid == mDrawingMask)
-        [self setDrawingMask: kMKCPolishDrawBottomLine | kMKCPolishDrawTopLine | kMKCPolishDrawTopAccent | kMKCPolishDrawRightLine];
 	
 	NSDictionary* enabledColours = nil;
 	if (MKCShouldDrawEnabled ([self window]))

BaseTenAssistant/Source/MKCPolishedHeaderView.h

                              kMKCPolishDrawLeftAccent | 
                              kMKCPolishDrawRightAccent | 
                              kMKCPolishDrawSeparatorLines),
-    kMKCPolishDrawingMaskInvalid = 1 << 31
 };
 
 

BaseTenAssistant/Source/MKCPolishedHeaderView.m

 
 - (void) awakeFromNib
 {
-	mDrawingMask = kMKCPolishDrawingMaskInvalid;		
 	NSKeyValueObservingOptions options = NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew | NSKeyValueObservingOptionInitial;
 	[[self tableView] addObserver: self forKeyPath: @"sortDescriptors" options: options context: kKVObservingContext];
 	
 {
     if (nil == mColours)
         [self setColours: [[self class] darkColours]];
-    if (kMKCPolishDrawingMaskInvalid == mDrawingMask)
-        [self setDrawingMask: kMKCPolishDrawBottomLine | kMKCPolishDrawTopLine | kMKCPolishDrawTopAccent];
     
     float height = [self bounds].size.height;
     NSAssert (height >= 3.0, @"This view may not be shorter than 3.0 units.");