wip: replace workspace tabs with horizontal layer-driven editing and persistent four-up scopes
这个提交包含在:
1 父节点
57059390d1
当前提交
1396d5b7bf
18 个文件已更改
+207
-147
没有与搜索条件相匹配的文件
@@ -167,7 +167,7 @@ static void DYBrowserGeometrySample(NSView *root,NSString *phase){
|
||||
NSProgress *_libraryTask,*_selectionTask;
|
||||
NSTimer *_progressTimer;
|
||||
NSUInteger _libraryGeneration,_selectionGeneration;
|
||||
NSInteger _columns;
|
||||
NSInteger _columns,_horizontalRows;
|
||||
CGFloat _tileWidth,_tileHeight,_sidebarWidth;
|
||||
}
|
||||
@end
|
||||
@@ -272,7 +272,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
|
||||
NSAccessibilityPostNotification(parent,NSAccessibilityLayoutChangedNotification);
|
||||
}
|
||||
- (void)embedInView:(NSView *)parent close:(void (^)(void))closeAction{
|
||||
_embedded=YES;[self showInRemoteParent:parent close:closeAction];_done.title=@"返回调整";
|
||||
_embedded=YES;_folderScroll.hasVerticalScroller=NO;_gridScroll.hasVerticalScroller=NO;_gridScroll.hasHorizontalScroller=YES;_gridScroll.scrollerStyle=NSScrollerStyleOverlay;[self showInRemoteParent:parent close:closeAction];_done.title=@"返回调整";
|
||||
}
|
||||
- (void)fitRemoteParent{
|
||||
NSView *parent=_root.superview;if(_closed||!_remoteMode||!parent)return;
|
||||
@@ -383,7 +383,7 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
|
||||
BOOL list=_layoutMenu.indexOfSelectedItem==1;NSInteger columns=list?1:MAX(1,(NSInteger)floor((available+gap)/(tileWidth+gap)));tileWidth=list?MAX(110,available-14):MIN(tileWidth,(available-gap*(columns-1)-14)/columns);tileWidth=MAX(70,tileWidth);
|
||||
_columns=columns;_tileWidth=tileWidth;_tileHeight=list?70:ceil(tileWidth*9/16)+24;
|
||||
NSInteger rows=(_visibleEntries.count+columns-1)/columns;CGFloat contentHeight=MAX(_gridScroll.contentSize.height,rows*(_tileHeight+gap)+12);
|
||||
_gridDocument.frame=NSMakeRect(0,0,available,contentHeight);_emptyLabel.frame=NSMakeRect(20,MAX(36,_gridScroll.contentSize.height/2-45),MAX(50,available-40),90);
|
||||
if(_embedded){_horizontalRows=MAX(1,NSInteger((_gridScroll.contentSize.height-12)/(_tileHeight+gap)));NSInteger horizontalColumns=(_visibleEntries.count+_horizontalRows-1)/_horizontalRows;_gridDocument.frame=NSMakeRect(0,0,MAX(available,horizontalColumns*(_tileWidth+gap)+14),_gridScroll.contentSize.height);}else{_horizontalRows=0;_gridDocument.frame=NSMakeRect(0,0,available,contentHeight);}_emptyLabel.frame=NSMakeRect(20,MAX(36,_gridScroll.contentSize.height/2-45),MAX(50,available-40),90);
|
||||
_layingOut=NO;[self updateVisibleTiles];
|
||||
}
|
||||
- (CGFloat)splitView:(NSSplitView *)split constrainMinCoordinate:(CGFloat)proposed ofSubviewAt:(NSInteger)index{return 128;}
|
||||
@@ -400,11 +400,12 @@ static NSButton *BrowserButton(NSString *title,id target,SEL action){NSButton *b
|
||||
NSRect visible=NSInsetRect(_gridScroll.contentView.bounds,-30,-180);CGFloat step=_tileHeight+10;
|
||||
NSUInteger first=(NSUInteger)MAX(0,floor((NSMinY(visible)-8)/step))*_columns;
|
||||
NSUInteger end=MIN(_visibleEntries.count,(NSUInteger)MAX(0,ceil((NSMaxY(visible)-8)/step)+1)*_columns);
|
||||
if(_horizontalRows){CGFloat horizontalStep=_tileWidth+10;first=(NSUInteger)MAX(0,floor((NSMinX(visible)-7)/horizontalStep))*_horizontalRows;end=MIN(_visibleEntries.count,(NSUInteger)MAX(0,ceil((NSMaxX(visible)-7)/horizontalStep)+1)*_horizontalRows);}
|
||||
NSMutableSet *wanted=[NSMutableSet set];BOOL changed=NO;
|
||||
for(NSUInteger i=first;i<end;i++){
|
||||
NSDictionary *entry=_visibleEntries[i];NSString *path=entry[@"path"];[wanted addObject:path];DYBrowserTile *tile=_tiles[path];
|
||||
if(!tile){tile=[[[DYBrowserTile alloc]initWithFrame:NSZeroRect]autorelease];tile.identifier=path;tile.displayName=entry[@"name"];tile.toolTip=entry[@"relativePath"]?:path;tile.palette=_palette;tile.chosen=[path isEqualToString:_selectedPath];tile.target=self;tile.action=@selector(thumbnailClicked:);tile.enabled=YES;[_gridDocument addSubview:tile];_tiles[path]=tile;changed=YES;}
|
||||
tile.listLayout=_layoutMenu.indexOfSelectedItem==1;tile.frame=NSMakeRect(7+(i%_columns)*(_tileWidth+10),8+(i/_columns)*step,_tileWidth,_tileHeight);
|
||||
tile.listLayout=_layoutMenu.indexOfSelectedItem==1;tile.frame=_horizontalRows?NSMakeRect(7+(i/_horizontalRows)*(_tileWidth+10),6+(i%_horizontalRows)*step,_tileWidth,_tileHeight):NSMakeRect(7+(i%_columns)*(_tileWidth+10),8+(i/_columns)*step,_tileWidth,_tileHeight);
|
||||
}
|
||||
for(NSString *path in _tiles.allKeys)if(![wanted containsObject:path]){[_tiles[path]removeFromSuperview];[_tiles removeObjectForKey:path];changed=YES;}
|
||||
if(changed||!_work)[self resetThumbnailWork];
|
||||
|
||||
在新工单中引用
屏蔽一个用户