Add improvements suggested by @fredkiefer

This commit is contained in:
Gregory John Casamento 2024-04-21 19:36:58 -04:00
parent 42bae42431
commit 48d031a14a
5 changed files with 14 additions and 40 deletions

View file

@ -1335,8 +1335,6 @@ APPKIT_EXPORT_CLASS
inView: (NSView *)view
selectingColumns: (BOOL)selectingColumns;
- (BOOL) isBoxOpaque: (NSBox *)box;
- (void) drawTableViewRow: (NSInteger)rowIndex
clipRect: (NSRect)clipRect
inView: (NSView *)view;
@ -1349,6 +1347,8 @@ APPKIT_EXPORT_CLASS
clipRect: (NSRect)clipRect
inView: (NSView *)view;
- (BOOL) isBoxOpaque: (NSBox *)box;
- (void) drawBoxInClipRect: (NSRect)clipRect
boxType: (NSBoxType)boxType
borderType: (NSBorderType)borderType

View file

@ -30,7 +30,7 @@
#import <Foundation/NSObject.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_13, GS_API_LATEST)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {

View file

@ -3310,8 +3310,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
NSIndexSet *selectedRows = [tableView selectedRowIndexes];
NSIndexSet *selectedColumns = [tableView selectedColumnIndexes];
// NSColor *backgroundColor = [tableView backgroundColor];
// Set the fill color
{
NSColor *selectionColor;
@ -3385,16 +3383,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
}
}
- (BOOL) isBoxOpaque: (NSBox *)box
{
if ([box boxType] == NSBoxCustom)
{
return ![box isTransparent];
}
return YES;
}
- (void) drawTableViewRow: (NSInteger)rowIndex
clipRect: (NSRect)clipRect
inView: (NSView *)view
@ -3836,6 +3824,16 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
}
}
- (BOOL) isBoxOpaque: (NSBox *)box
{
if ([box boxType] == NSBoxCustom)
{
return ![box isTransparent];
}
return YES;
}
- (void) drawBoxInClipRect: (NSRect)clipRect
boxType: (NSBoxType)boxType
borderType: (NSBorderType)borderType

View file

@ -2158,7 +2158,7 @@ Also returns the child index relative to this parent. */
{
NSCell *cell = nil;
if (_viewBased)
if (_viewBased == NO)
{
NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex];

View file

@ -74,17 +74,6 @@
#import "GSBindingHelpers.h"
// Private method on NSTableView to register views...
@interface NSTableView (NSTableColumnPrivate)
- (void) _registerView: (NSView *)view;
@end
@implementation NSTableView (NSTableColumnPrivate)
- (void) _registerView: (NSView *)view
{
}
@end
/**
<p>
NSTableColumn objects represent columns in NSTableViews.
@ -483,17 +472,6 @@ to YES. */
ASSIGN(_sortDescriptorPrototype, aSortDescriptor);
}
- (void) _registerPrototypes
{
NSEnumerator *en = [_prototypeCellViews objectEnumerator];
NSView *v = nil;
while ((v = [en nextObject]) != nil)
{
[_tableView _registerView: v];
}
}
/*
* Encoding/Decoding
*/
@ -602,7 +580,6 @@ to YES. */
if ([aDecoder containsValueForKey: @"NSPrototypeCellViews"])
{
ASSIGN(_prototypeCellViews, [aDecoder decodeObjectForKey: @"NSPrototypeCellViews"]);
[self _registerPrototypes];
}
}
else
@ -633,7 +610,6 @@ to YES. */
if (version >= 4)
{
_prototypeCellViews = RETAIN([aDecoder decodeObject]);
[self _registerPrototypes];
}
}
else