diff --git a/lib/UIKit/TUIScrollKnob.m b/lib/UIKit/TUIScrollKnob.m index 59e17eaa..660ed930 100644 --- a/lib/UIKit/TUIScrollKnob.m +++ b/lib/UIKit/TUIScrollKnob.m @@ -130,12 +130,16 @@ - (void)mouseEntered:(NSEvent *)event { _scrollKnobFlags.hover = 1; [self _updateKnobColor:0.08]; + // make sure we propagate mouse events + [super mouseEntered:event]; } - (void)mouseExited:(NSEvent *)event { _scrollKnobFlags.hover = 0; [self _updateKnobColor:0.25]; + // make sure we propagate mouse events + [super mouseExited:event]; } - (void)mouseDown:(NSEvent *)event diff --git a/lib/UIKit/TUIScrollView.h b/lib/UIKit/TUIScrollView.h index 9c994198..50cf00a1 100644 --- a/lib/UIKit/TUIScrollView.h +++ b/lib/UIKit/TUIScrollView.h @@ -57,10 +57,10 @@ typedef enum { @interface TUIScrollView : TUIView { - CGPoint _unroundedContentOffset; - CGSize _contentSize; - CGSize resizeKnobSize; - TUIEdgeInsets _contentInset; + CGPoint _unroundedContentOffset; + CGSize _contentSize; + CGSize resizeKnobSize; + TUIEdgeInsets _contentInset; id _delegate; TUIScrollKnob *_verticalScrollKnob; diff --git a/lib/UIKit/TUIScrollView.m b/lib/UIKit/TUIScrollView.m index b5c59608..781db3c8 100644 --- a/lib/UIKit/TUIScrollView.m +++ b/lib/UIKit/TUIScrollView.m @@ -915,7 +915,7 @@ - (void)scrollWheel:(NSEvent *)event -(void)mouseEntered:(NSEvent *)event onSubview:(TUIView *)subview { [super mouseEntered:event onSubview:subview]; - if(++_mouseInside == 1){ + if(_mouseInside++ < 1){ [self _updateScrollKnobs]; } } @@ -942,7 +942,7 @@ - (BOOL)performKeyAction:(NSEvent *)event case 63275: // end [self scrollToBottomAnimated:YES]; return YES; - case 32: + case 32: // spacebar if([NSEvent modifierFlags] & NSShiftKeyMask) [self pageUp:nil]; else diff --git a/lib/UIKit/TUITableViewCell.m b/lib/UIKit/TUITableViewCell.m index caab428f..4356f938 100644 --- a/lib/UIKit/TUITableViewCell.m +++ b/lib/UIKit/TUITableViewCell.m @@ -103,6 +103,8 @@ - (void)mouseDown:(NSEvent *)event * @brief The table cell was dragged */ -(void)mouseDragged:(NSEvent *)event { + // propagate the event + [super mouseDragged:event]; // notify our table view of the event [self.tableView __mouseDraggedCell:self offset:_mouseOffset event:event]; } diff --git a/lib/UIKit/TUIView+Event.m b/lib/UIKit/TUIView+Event.m index 23474631..7750f641 100644 --- a/lib/UIKit/TUIView+Event.m +++ b/lib/UIKit/TUIView+Event.m @@ -42,6 +42,11 @@ - (void)mouseDown:(NSEvent *)event _viewFlags.dragDistanceLock = 1; _viewFlags.didStartMovingByDragging = 0; _viewFlags.didStartResizeByDragging = 0; + + if(self.superview != nil){ + [self.superview mouseDown:event onSubview:self]; + } + } - (void)mouseUp:(NSEvent *)event @@ -138,6 +143,11 @@ - (void)mouseDragged:(NSEvent *)event if(!_currentTextRenderer && _viewFlags.pasteboardDraggingEnabled) [self pasteboardDragMouseDragged:event]; } + + if(self.superview != nil){ + [self.superview mouseDragged:event onSubview:self]; + } + } - (BOOL)didDrag @@ -192,12 +202,12 @@ - (void)viewDidEndLiveResize - (void)mouseDown:(NSEvent *)event onSubview:(TUIView *)subview { - + [self.superview mouseDown:event onSubview:subview]; } - (void)mouseDragged:(NSEvent *)event onSubview:(TUIView *)subview { - + [self.superview mouseDragged:event onSubview:subview]; } - (void)mouseUp:(NSEvent *)event fromSubview:(TUIView *)subview @@ -210,7 +220,7 @@ - (void)mouseUp:(NSEvent *)event fromSubview:(TUIView *)subview - (void)rightMouseDown:(NSEvent *)event onSubview:(TUIView *)subview { - + [self.superview rightMouseDown:event onSubview:subview]; } - (void)rightMouseUp:(NSEvent *)event fromSubview:(TUIView *)subview @@ -221,16 +231,12 @@ - (void)rightMouseUp:(NSEvent *)event fromSubview:(TUIView *)subview - (void)mouseEntered:(NSEvent *)event onSubview:(TUIView *)subview { - if(self.superview != nil){ - [self.superview mouseEntered:event onSubview:subview]; - } + [self.superview mouseEntered:event onSubview:subview]; } - (void)mouseExited:(NSEvent *)event fromSubview:(TUIView *)subview { - if(self.superview != nil){ - [self.superview mouseExited:event fromSubview:subview]; - } + [self.superview mouseExited:event fromSubview:subview]; } @end