wip: replace workspace tabs with horizontal layer-driven editing and persistent four-up scopes
这个提交包含在:
1 父节点
57059390d1
当前提交
1396d5b7bf
18 个文件已更改
+207
-147
没有与搜索条件相匹配的文件
+5
-2
@@ -108,6 +108,8 @@ void DYDrawSoftControl(NSRect rect,CGFloat radius,BOOL recessed,BOOL emphasized,
|
||||
NSBezierPath *inner=[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(rect,1.5,1.5) xRadius:MAX(0,radius-1.5) yRadius:MAX(0,radius-1.5)];
|
||||
[[rgb(.40,.60,.73)colorWithAlphaComponent:strong?.35:.12]setStroke];inner.lineWidth=.5;[inner stroke];
|
||||
}
|
||||
BOOL DYThemeWorkspaceContext(NSView *view){for(NSView *ancestor=view;ancestor;ancestor=ancestor.superview)if([ancestor.identifier isEqual:@"DYColorWorkspace"])return YES;return NO;}
|
||||
static void drawWorkspaceControl(NSRect frame,BOOL pressed){NSBezierPath *shape=[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(frame,1,2) xRadius:3 yRadius:3];[[NSColor colorWithWhite:DYThemeIsLight()?(pressed?.72:.81):(pressed?.19:.25) alpha:1]setFill];[shape fill];[[NSColor colorWithWhite:DYThemeIsLight()?.57:.34 alpha:1]setStroke];shape.lineWidth=NSWorkspace.sharedWorkspace.accessibilityDisplayShouldIncreaseContrast?1.5:.5;[shape stroke];}
|
||||
@implementation DYThemeLabel
|
||||
- (void)drawRect:(NSRect)rect {[super drawRect:rect];}
|
||||
@end
|
||||
@@ -121,6 +123,7 @@ void DYDrawSoftControl(NSRect rect,CGFloat radius,BOOL recessed,BOOL emphasized,
|
||||
}
|
||||
- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)view {
|
||||
if(!self.bordered){[super drawBezelWithFrame:frame inView:view];return;}
|
||||
if(DYThemeWorkspaceContext(view)){drawWorkspaceControl(frame,self.highlighted);return;}
|
||||
BOOL selected=[view.identifier isEqual:@"appearanceToggle"]&&self.state==NSControlStateValueOn;
|
||||
DYDrawSoftControl(NSInsetRect(frame,2,3),7,selected,[view.identifier isEqual:@"primaryAction"],self.highlighted);
|
||||
}
|
||||
@@ -128,13 +131,13 @@ void DYDrawSoftControl(NSRect rect,CGFloat radius,BOOL recessed,BOOL emphasized,
|
||||
@implementation DYThemeButton
|
||||
+ (Class)cellClass {return DYThemeButtonCell.class;}
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
if([self.identifier isEqual:@"layerAction"])DYDrawSoftControl(NSInsetRect(self.bounds,2,2),6,NO,NO,self.cell.highlighted);
|
||||
if([self.identifier isEqual:@"layerAction"]&&!DYThemeWorkspaceContext(self))DYDrawSoftControl(NSInsetRect(self.bounds,2,2),6,NO,NO,self.cell.highlighted);
|
||||
[super drawRect:rect];
|
||||
}
|
||||
@end
|
||||
@implementation DYThemePopUpButton
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
NSRect bounds=NSInsetRect(self.bounds,2,3);NSBezierPath *path=[NSBezierPath bezierPathWithRoundedRect:bounds xRadius:6 yRadius:6];DYDrawSoftControl(bounds,6,NO,NO,self.cell.highlighted);
|
||||
NSRect bounds=NSInsetRect(self.bounds,2,3);NSBezierPath *path=[NSBezierPath bezierPathWithRoundedRect:bounds xRadius:6 yRadius:6];if(DYThemeWorkspaceContext(self))drawWorkspaceControl(self.bounds,self.cell.highlighted);else DYDrawSoftControl(bounds,6,NO,NO,self.cell.highlighted);
|
||||
NSMutableDictionary *attributes=[NSMutableDictionary dictionaryWithDictionary:DYThemeTextAttributes(self.font?:[NSFont systemFontOfSize:11],[DYThemeColor(@"text")colorWithAlphaComponent:self.enabled?1:.45])];NSMutableParagraphStyle *paragraph=[[[NSMutableParagraphStyle alloc]init]autorelease];paragraph.lineBreakMode=NSLineBreakByTruncatingTail;attributes[NSParagraphStyleAttributeName]=paragraph;
|
||||
CGFloat y=NSMidY(self.bounds)-(self.font?:[NSFont systemFontOfSize:11]).pointSize*.62;
|
||||
[(self.pullsDown?[self itemAtIndex:0].title:(self.selectedItem.title?:@""))drawInRect:NSMakeRect(9,y,MAX(0,self.bounds.size.width-29),18) withAttributes:attributes];
|
||||
|
||||
在新工单中引用
屏蔽一个用户