mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-02-17 10:08:46 +00:00
merge with timschmielau-cocotron
This commit is contained in:
commit
3a4ee557c9
@ -475,13 +475,13 @@ NSString * const NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification";
|
||||
if (size.width > _maxContentSize.width && _maxContentSize.width > 0)
|
||||
size.width = _maxContentSize.width;
|
||||
|
||||
size.height = [self contentSize].height;
|
||||
size.height = _contentSize.height;
|
||||
}
|
||||
else {
|
||||
if (size.height > _maxContentSize.height && _maxContentSize.height > 0)
|
||||
size.height = _maxContentSize.height;
|
||||
|
||||
size.width = [self contentSize].width;
|
||||
size.width = _contentSize.width;
|
||||
}
|
||||
|
||||
[self setContentSize:size];
|
||||
|
@ -929,9 +929,14 @@ _dataSource);
|
||||
// Deprecated in Mac OS X 10.3.
|
||||
-(void)selectRow:(int)row byExtendingSelection:(BOOL)extend {
|
||||
|
||||
if (extend)
|
||||
[self selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange([self selectedRow], row)] byExtendingSelection:NO];
|
||||
else
|
||||
if (extend) {
|
||||
NSUInteger startRow=[self selectedRow], endRow=row;
|
||||
if (startRow>endRow) {
|
||||
endRow=startRow;
|
||||
startRow=row;
|
||||
}
|
||||
[self selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(startRow, endRow-startRow+1)] byExtendingSelection:NO];
|
||||
} else
|
||||
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
@ -1580,7 +1585,7 @@ _dataSource);
|
||||
startRow = _clickedRow;
|
||||
}
|
||||
|
||||
[self selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(startRow, endRow)] byExtendingSelection:NO];
|
||||
[self selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(startRow, endRow-startRow+1)] byExtendingSelection:NO];
|
||||
}
|
||||
else
|
||||
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:_clickedRow] byExtendingSelection:NO];
|
||||
|
@ -175,7 +175,8 @@ APPKIT_EXPORT NSString * const NSWindowDidEndLiveResizeNotification;
|
||||
BOOL _autorecalculatesKeyViewLoop;
|
||||
BOOL _hasBeenOnScreen;
|
||||
|
||||
BOOL _inLiveResize;
|
||||
BOOL _isInLiveResize;
|
||||
BOOL _preservesContentDuringLiveResize;
|
||||
NSSize _resizeIncrements;
|
||||
NSSize _contentResizeIncrements;
|
||||
|
||||
|
@ -290,6 +290,8 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
|
||||
_viewsNeedDisplay=YES;
|
||||
_flushNeeded=YES;
|
||||
|
||||
_isInLiveResize=NO;
|
||||
|
||||
_resizeIncrements=NSMakeSize(1,1);
|
||||
_contentResizeIncrements=NSMakeSize(1,1);
|
||||
|
||||
@ -691,6 +693,8 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
|
||||
{ NSWindowDidResignKeyNotification,@selector(windowDidResignKey:) },
|
||||
{ NSWindowDidResignMainNotification,@selector(windowDidResignMain:) },
|
||||
{ NSWindowDidResizeNotification,@selector(windowDidResize:) },
|
||||
{ NSWindowWillStartLiveResizeNotification,@selector(windowWillStartLiveResize:) },
|
||||
{ NSWindowDidEndLiveResizeNotification,@selector(windowDidEndLiveResize:) },
|
||||
{ NSWindowDidUpdateNotification,@selector(windowDidUpdate:) },
|
||||
{ NSWindowWillCloseNotification,@selector(windowWillClose:) },
|
||||
{ NSWindowWillMiniaturizeNotification,@selector(windowWillMiniaturize:) },
|
||||
@ -1429,7 +1433,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
|
||||
}
|
||||
|
||||
-(BOOL)inLiveResize {
|
||||
return _inLiveResize;
|
||||
return _isInLiveResize;
|
||||
}
|
||||
|
||||
-(BOOL)canBecomeKeyWindow {
|
||||
@ -2854,12 +2858,12 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
|
||||
|
||||
-(void)platformWindowWillBeginSizing:(CGWindow *)window {
|
||||
[self postNotificationName:NSWindowWillStartLiveResizeNotification];
|
||||
_inLiveResize=YES;
|
||||
_isInLiveResize=YES;
|
||||
[_backgroundView viewWillStartLiveResize];
|
||||
}
|
||||
|
||||
-(void)platformWindowDidEndSizing:(CGWindow *)window {
|
||||
_inLiveResize=NO;
|
||||
_isInLiveResize=NO;
|
||||
[_backgroundView viewDidEndLiveResize];
|
||||
[self postNotificationName:NSWindowDidEndLiveResizeNotification];
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ static BOOL CALLBACK monitorEnumerator(HMONITOR hMonitor,HDC hdcMonitor,LPRECT r
|
||||
[[NSRunLoop currentRunLoop] addInputSource:_eventInputSource forMode:mode];
|
||||
[self stopWaitCursor];
|
||||
|
||||
while([untilDate timeIntervalSinceNow]>0 || [_eventQueue count]>0){
|
||||
do{
|
||||
result=[super nextEventMatchingMask:mask|NSPlatformSpecificDisplayMask untilDate:untilDate inMode:mode dequeue:dequeue];
|
||||
|
||||
if([result type]==NSPlatformSpecificDisplayEvent){
|
||||
@ -412,7 +412,7 @@ static BOOL CALLBACK monitorEnumerator(HMONITOR hMonitor,HDC hdcMonitor,LPRECT r
|
||||
|
||||
if(result!=nil)
|
||||
break;
|
||||
}
|
||||
}while([untilDate timeIntervalSinceNow]>0 || [_eventQueue count]>0);
|
||||
[self startWaitCursor];
|
||||
|
||||
// [[NSRunLoop currentRunLoop] removeInputSource:_eventInputSource forMode:mode];
|
||||
|
@ -42,7 +42,7 @@ static inline unsigned OBJCHashString (const void *data) {
|
||||
result=5381;
|
||||
|
||||
for(i=0;s[i]!='\0';i++)
|
||||
result=((result<<5)+result)+s[i]; // hash*33+c
|
||||
result=(((result<<5)|(result>>27))+result)+s[i]; // hash*33 % (2^32-1) + c (barring overflow during additions)
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user