Revision: 26247
          http://sourceforge.net/p/bibdesk/svn/26247
Author:   hofman
Date:     2021-06-17 14:14:42 +0000 (Thu, 17 Jun 2021)
Log Message:
-----------
No need for outlineview subclass, this is done now by the row view

Modified Paths:
--------------
    trunk/bibdesk/BDSKFileMatcher.h
    trunk/bibdesk/BDSKFileMatcher.m
    trunk/bibdesk/Base.lproj/FileMatcher.xib

Modified: trunk/bibdesk/BDSKFileMatcher.h
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.h     2021-06-17 09:39:37 UTC (rev 26246)
+++ trunk/bibdesk/BDSKFileMatcher.h     2021-06-17 14:14:42 UTC (rev 26247)
@@ -38,13 +38,12 @@
 
 #import <Cocoa/Cocoa.h>
 #import <Quartz/Quartz.h>
-#import "BDSKOutlineView.h"
 
-@class BDSKGroupingOutlineView;
+@class BDSKOutlineView;
 
 @interface BDSKFileMatcher : NSWindowController <NSOutlineViewDelegate, 
NSOutlineViewDataSource, QLPreviewPanelDataSource, QLPreviewPanelDelegate>
 {
-    BDSKGroupingOutlineView *outlineView;
+    BDSKOutlineView *outlineView;
     NSProgressIndicator *progressIndicator;
     NSTextField *statusField;
     NSButton *abortButton;
@@ -62,7 +61,7 @@
 
 + (id)sharedInstance;
 
-@property (nonatomic, assign) IBOutlet BDSKGroupingOutlineView *outlineView;
+@property (nonatomic, assign) IBOutlet BDSKOutlineView *outlineView;
 @property (nonatomic, assign) IBOutlet NSProgressIndicator *progressIndicator;
 @property (nonatomic, assign) IBOutlet NSTextField *statusField;
 @property (nonatomic, assign) IBOutlet NSButton *abortButton;
@@ -77,15 +76,7 @@
 
 @end
 
-/* Groups items under the top-level outline, and uses a gradient fill for the 
top level row background.  Grid lines are drawn when the outline has data.
+/* Groups items under the top-level outline, and uses a gradient fill for the 
top level row background.
 */
-
-@interface BDSKGroupingOutlineView : BDSKOutlineView
-{
-    NSColor *topColor;
-    NSColor *bottomColor;
-}
-@end
-
 @interface BDSKHeadRowView : NSTableRowView
 @end

Modified: trunk/bibdesk/BDSKFileMatcher.m
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.m     2021-06-17 09:39:37 UTC (rev 26246)
+++ trunk/bibdesk/BDSKFileMatcher.m     2021-06-17 14:14:42 UTC (rev 26247)
@@ -47,9 +47,9 @@
 #import "BibAuthor.h"
 #import <libkern/OSAtomic.h>
 #import "BDSKFileMatchConfigController.h"
+#import "BDSKOutlineView.h"
 #import "NSGeometry_BDSKExtensions.h"
 #import "NSBezierPath_BDSKExtensions.h"
-#import "BDSKLevelIndicatorCell.h"
 #import "BDSKLinkedFile.h"
 #import "NSParagraphStyle_BDSKExtensions.h"
 #import "NSInvocation_BDSKExtensions.h"
@@ -61,8 +61,8 @@
 #define BDSKShouldLogFilesAddedToMatchingSearchIndexKey 
@"BDSKShouldLogFilesAddedToMatchingSearchIndex"
 
 #define MAX_SEARCHKIT_RESULTS 10
-static CGFloat LEAF_ROW_HEIGHT = 20.0;
-static CGFloat GROUP_ROW_HEIGHT = 24.0;
+#define LEAF_ROW_HEIGHT 20.0
+#define GROUP_ROW_HEIGHT 24.0
 
 @interface BDSKCenteredTextFieldCell : NSTextFieldCell
 @end
@@ -136,8 +136,6 @@
     [outlineView setAutosaveExpandedItems:YES];
     [outlineView setAutoresizesOutlineColumn:NO];
 
-    [[[outlineView tableColumnWithIdentifier:@"score"] dataCell] 
setMaxHeight:(LEAF_ROW_HEIGHT * 0.7)];
-    
     [outlineView setDoubleAction:@selector(openAction:)];
     [outlineView setTarget:self];
     [outlineView registerForDraggedTypes:[NSArray arrayWithObjects:(NSString 
*)kUTTypeFileURL, NSFilenamesPboardType, nil]];
@@ -678,100 +676,6 @@
 
 #pragma mark -
 
-@implementation BDSKGroupingOutlineView
-
-- (void)dealloc
-{
-    BDSKDESTROY(topColor);
-    BDSKDESTROY(bottomColor);
-    [super dealloc];
-}
-
-// @@ Dark mode
-
-- (void)commonInit
-{
-    // colors similar to Spotlight's window: darker blue at bottom, lighter at 
top
-    topColor = [[NSColor colorWithCalibratedRed:106.0/255.0 green:158.0/255.0 
blue:238.0/255.0 alpha:1.0] retain];
-    bottomColor = [[NSColor colorWithCalibratedRed:72.0/255.0 
green:139.0/255.0 blue:244.0/255.0 alpha:1.0] retain];
-}
-
-- (id)initWithFrame:(NSRect)frameRect
-{
-    self = [super initWithFrame:frameRect];
-    if (self) {
-        [self commonInit];
-    }
-    return self;
-}
-
-- (id)initWithCoder:(NSCoder *)decoder
-{
-    self = [super initWithCoder:decoder];
-    if (self) {
-        [self commonInit];
-    }
-    return self;
-}
-
-// these accessors are bound to the hidden color wells in the nib, which allow 
playing with the colors easily
-- (NSColor *)topColor
-{
-    return topColor;
-}
-
-- (void)setTopColor:(NSColor *)color
-{
-    if (topColor != color) {
-        [topColor release];
-        topColor = [color retain];
-    }
-}
-
-- (void)setBottomColor:(NSColor *)color
-{
-    if (bottomColor != color) {
-        [bottomColor release];
-        bottomColor = [color retain];
-    }
-}
-
-- (NSColor *)bottomColor 
-{ 
-    return bottomColor;
-}
-
-// grid looks silly when the table is empty
-- (void)drawGridInClipRect:(NSRect)rect;
-{
-    if ([self numberOfRows])
-        [super drawGridInClipRect:rect];
-}
-
-- (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect
-{
-    if (RUNNING_BEFORE(10_10) && [self isExpandable:[self 
itemAtRow:rowIndex]]) {
-        NSGradient *gradient = [[[NSGradient alloc] 
initWithStartingColor:bottomColor endingColor:topColor] autorelease];
-        [gradient drawInRect:[self rectOfRow:rowIndex] angle:[self isFlipped] 
? -90.0 : 90.0];
-    }
-    [super drawRow:rowIndex clipRect:clipRect];
-}
-
-// @@ Dark mode
-
-- (void)_drawDropHighlightOnRow:(NSInteger)rowIndex
-{
-    if (RUNNING_BEFORE(10_10)) {
-        NSRect drawRect = (rowIndex == -1) ? [self visibleRect] : [self 
rectOfRow:rowIndex];
-        [NSBezierPath drawHighlightInRect:drawRect radius:4.0 lineWidth:2.0 
color:[NSColor whiteColor]];
-    } else {
-        [super _drawDropHighlightOnRow:rowIndex];
-    }
-}
-
-@end
-
-
 @implementation BDSKHeadRowView
 
 // colors similar to Spotlight's window: darker blue at bottom, lighter at top
@@ -790,6 +694,8 @@
 }
 
 - (void)drawBackgroundInRect:(NSRect)dirtyRect {
+    [super drawBackgroundInRect:dirtyRect];
+    
     NSGradient *gradient = [[[NSGradient alloc] initWithStartingColor:[[self 
class] bottomColor] endingColor:[[self class] topColor]] autorelease];
     [gradient drawInRect:[self bounds] angle:[self isFlipped] ? -90.0 : 90.0];
 }
@@ -798,4 +704,8 @@
     return NSBackgroundStyleDark;
 }
 
+- (void)drawDraggingDestinationFeedbackInRect:(NSRect)dirtyRect {
+    [NSBezierPath drawHighlightInRect:[self bounds] radius:4.0 lineWidth:2.0 
color:[NSColor whiteColor]];
+}
+
 @end

Modified: trunk/bibdesk/Base.lproj/FileMatcher.xib
===================================================================
--- trunk/bibdesk/Base.lproj/FileMatcher.xib    2021-06-17 09:39:37 UTC (rev 
26246)
+++ trunk/bibdesk/Base.lproj/FileMatcher.xib    2021-06-17 14:14:42 UTC (rev 
26247)
@@ -35,7 +35,7 @@
                             <rect key="frame" x="1" y="1" width="478" 
height="281"/>
                             <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
                             <subviews>
-                                <outlineView verticalHuggingPriority="750" 
allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" 
multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="16" 
viewBased="YES" indentationPerLevel="16" autoresizesOutlineColumn="YES" 
outlineTableColumn="9" id="8" customClass="BDSKGroupingOutlineView">
+                                <outlineView verticalHuggingPriority="750" 
allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" 
multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="16" 
viewBased="YES" indentationPerLevel="16" autoresizesOutlineColumn="YES" 
outlineTableColumn="9" id="8" customClass="BDSKOutlineView">
                                     <rect key="frame" x="0.0" y="0.0" 
width="478" height="281"/>
                                     <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
                                     <size key="intercellSpacing" width="3" 
height="2"/>

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to