diff --git a/AppKit/CPRuleEditor/CPRuleEditor.j b/AppKit/CPRuleEditor/CPRuleEditor.j index 404c5546e..141e06d63 100644 --- a/AppKit/CPRuleEditor/CPRuleEditor.j +++ b/AppKit/CPRuleEditor/CPRuleEditor.j @@ -2121,7 +2121,7 @@ TODO: implement return; var point = [self convertPoint:[event locationInWindow] fromView:nil], - view = [_slices objectAtIndex:FLOOR(point.y / _sliceHeight)]; + view = [_slices objectAtIndex:FLOOR(MAX(0, point.y) / _sliceHeight)]; if ([self _dragShouldBeginFromMouseDown:view]) [self _performDragForSlice:view withEvent:event]; diff --git a/AppKit/CPTabView.j b/AppKit/CPTabView.j index baefde563..a99ee9c9d 100644 --- a/AppKit/CPTabView.j +++ b/AppKit/CPTabView.j @@ -34,6 +34,8 @@ CPNoTabsBezelBorder = 4; //Displays no tabs and has a bezeled border. CPNoTabsLineBorder = 5; //Has no tabs and displays a line border. CPNoTabsNoBorder = 6; //Displays no tabs and no border. +@class _CPTabViewBox + var CPTabViewDidSelectTabViewItemSelector = 1 << 1, CPTabViewShouldSelectTabViewItemSelector = 1 << 2, CPTabViewWillSelectTabViewItemSelector = 1 << 3, @@ -64,7 +66,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, CPArray _items; CPSegmentedControl _tabs; - CPBox _box; + _CPTabViewBox _box; CPNumber _selectedIndex; @@ -98,7 +100,8 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, var height = [_tabs valueForThemeAttribute:@"min-size"].height; [_tabs setFrameSize:CGSizeMake(0, height)]; - _box = [[CPBox alloc] initWithFrame:[self bounds]]; + _box = [[_CPTabViewBox alloc] initWithFrame:[self bounds]]; + [_box setTabView:self]; [self setBackgroundColor:[CPColor colorWithCalibratedWhite:0.95 alpha:1.0]]; [self addSubview:_box]; @@ -496,6 +499,18 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, [self selectFirstTabViewItem:self]; } + +#pragma mark - +#pragma mark Override + +/*! + Enabled controls accept first mouse by default. +*/ +- (BOOL)acceptsFirstMouse:(CPEvent)anEvent +{ + return YES; +} + @end var CPTabViewItemsKey = "CPTabViewItemsKey", @@ -571,3 +586,26 @@ var CPTabViewItemsKey = "CPTabViewItemsKey", } @end + +@implementation _CPTabViewBox : CPBox +{ + CPTabView _tabView @accessors(property=tabView); +} + + +#pragma mark - +#pragma mark Override + +- (CPView)hitTest:(CGPoint)aPoint +{ + // Here we check if we have clicked on the segmentedControl of the tabView or not + // If YES, the CPBox should not handle the click + var segmentIndex = [_tabView._tabs testSegment:[_tabView._tabs convertPoint:aPoint fromView:[self superview]]]; + + if (segmentIndex != CPNotFound) + return nil; + + return [super hitTest:aPoint]; +} + +@end \ No newline at end of file diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 82db0b74c..e1b0fcaa2 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -2570,7 +2570,7 @@ setBoundsOrigin: } #if PLATFORM(DOM) - if (_needToSetTransformMatrix) + if (_needToSetTransformMatrix && _highDPIRatio !== 1) [_graphicsContext graphicsPort].setTransform(_highDPIRatio, 0, 0 , _highDPIRatio, 0, 0); #endif diff --git a/AppKit/_CPToolTip.j b/AppKit/_CPToolTip.j index 6268f8ab4..296293d02 100644 --- a/AppKit/_CPToolTip.j +++ b/AppKit/_CPToolTip.j @@ -176,6 +176,8 @@ var _CPToolTipHeight = 24.0, _toolTipWindow = aWindow; _constrainsToUsableScreen = NO; + [self setPlatformWindow:[_toolTipWindow platformWindow]]; + textFrameSize.height += 4; _content = [CPTextField labelWithTitle:aString]; @@ -193,6 +195,7 @@ var _CPToolTipHeight = 24.0, [self setAlphaValue:0.9]; [_windowView setNeedsDisplay:YES]; + } return self;