Revision: 29183
http://sourceforge.net/p/bibdesk/svn/29183
Author: hofman
Date: 2025-04-24 09:45:07 +0000 (Thu, 24 Apr 2025)
Log Message:
-----------
Make all subviews subclass of FVDisplayView, so they wwill implement hitTest:
and isFlipped
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-24
08:33:41 UTC (rev 29182)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-24
09:45:07 UTC (rev 29183)
@@ -143,7 +143,19 @@
#pragma mark -
-@interface FVBackgroundView : NSView {
+@protocol FVDisplayViewDelegate
+- (void)displayView:(FVDisplayView *)view drawRect:(NSRect)rect;
+@end
+
+@interface FVDisplayView : NSView {
+ __weak id<FVDisplayViewDelegate> _delegate;
+}
+@property (nonatomic, weak) id<FVDisplayViewDelegate> delegate;
+@end
+
+#pragma mark -
+
+@interface FVBackgroundView : FVDisplayView {
NSColor *_backgroundColor;
}
@property (nonatomic, strong) NSColor *backgroundColor;
@@ -151,7 +163,7 @@
#pragma mark -
-@interface FVHighlightView : NSView {
+@interface FVHighlightView : FVDisplayView {
NSArray *_highlightRects;
FVHighlightStyle _highlightStyle;
CGLayerRef _layer;
@@ -163,23 +175,11 @@
#pragma mark -
-@interface FVRubberBandView : NSView
+@interface FVRubberBandView : FVDisplayView
@end
#pragma mark -
-@protocol FVDisplayViewDelegate
-- (void)drawRect:(NSRect)rect inView:(NSView *)view;
-@end
-
-@interface FVDisplayView : NSView {
- __weak id<FVDisplayViewDelegate> _delegate;
-}
-@property (nonatomic, weak) id<FVDisplayViewDelegate> delegate;
-@end
-
-#pragma mark -
-
@interface FVDropHighlightView : FVDisplayView {
NSUInteger _dropIndex;
FVDropOperation _dropOperation;
@@ -2601,7 +2601,7 @@
#endif
}
-- (void)drawRect:(NSRect)rect inView:(NSView *)view
+- (void)displayView:(FVDisplayView *)view drawRect:(NSRect)rect
{
if (view == _contentView)
[self _drawIconsInRect:rect];
@@ -5000,10 +5000,6 @@
[coder encodeObject:_backgroundColor forKey:@"backgroundColor"];
}
-- (BOOL)isFlipped { return YES; }
-
-- (NSView *)hitTest:(NSPoint)point { return nil; }
-
#if !defined(MAC_OS_X_VERSION_10_10) || MAC_OS_X_VERSION_MIN_REQUIRED <
MAC_OS_X_VERSION_10_10
- (void)_handleKeyOrMainStateNotification:(NSNotification *)note {
@@ -5132,25 +5128,11 @@
@synthesize highlightRects=_highlightRects;
@synthesize highlightStyle=_highlightStyle;
-- (id)initWithCoder:(NSCoder *)coder
-{
- self = [super initWithCoder:coder];
- if (self) {
- if ([[self subviews] count])
- [[[self subviews] objectAtIndex:0] removeFromSuperview];
- }
- return self;
-}
-
- (void)dealloc {
CGLayerRelease(_layer);
_layer = NULL;
}
-- (BOOL)isFlipped { return YES; }
-
-- (NSView *)hitTest:(NSPoint)point { return nil; }
-
- (void)viewDidChangeEffectiveAppearance {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
@@ -5311,8 +5293,6 @@
@implementation FVRubberBandView
-- (NSView *)hitTest:(NSPoint)point { return nil; }
-
- (void)drawRect:(NSRect)dirtyRect {
NSRect rect = [self bounds];
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.3] setFill];
@@ -5344,7 +5324,7 @@
- (NSView *)hitTest:(NSPoint)point { return nil; }
- (void)drawRect:(NSRect)dirtyRect {
- [_delegate drawRect:dirtyRect inView:self];
+ [_delegate displayView:self drawRect:dirtyRect];
}
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit