diff --git a/大鱼调色/Plugin/DYInspector.mm b/大鱼调色/Plugin/DYInspector.mm index 4b7ebe4..2f9715f 100644 --- a/大鱼调色/Plugin/DYInspector.mm +++ b/大鱼调色/Plugin/DYInspector.mm @@ -22,8 +22,11 @@ static NSButton *DYButton(NSString *title,id target,SEL action) { b.bezelStyle=NSBezelStyleRounded; b.font=[NSFont systemFontOfSize:11]; b.contentTintColor=DYAccent(); return b; } +static BOOL DYStrengthUsesUnitRange(NSDictionary *d) { + return [d[@"key"] hasSuffix:@"Strength"] && [d[@"max"] doubleValue]<=1; +} static NSString *DYNumber(double value,NSDictionary *d) { - if([d[@"key"] hasSuffix:@"Strength"]||[d[@"key"] isEqual:@"preLUTStrength"])return [NSString stringWithFormat:@"%.0f%%",value*100]; + if([d[@"key"] hasSuffix:@"Strength"])return [NSString stringWithFormat:@"%.0f%%",value*(DYStrengthUsesUnitRange(d)?100:1)]; double step=[d[@"step"] doubleValue]; return [NSString stringWithFormat:step>0&&step<.1?@"%.2f":step>0&&step<1?@"%.1f":@"%.0f",value]; } @@ -487,6 +490,12 @@ static NSImage *DYWheelImage(void) { enabled.tag=index; enabled.contentTintColor=DYAccent(); enabled.toolTip=@"启用或旁路本组"; enabled.accessibilityLabel=[section[@"title"] stringByAppendingString:@"启用"]; [card addSubview:enabled]; enabled.hidden=section[@"enabled"]==nil; + NSTextField *status=DYLabel(@"已旁路 · 可调整",10); + status.textColor=DYThemeColor(@"secondary");status.hidden=YES; + status.identifier=[section[@"key"] stringByAppendingString:@"BypassStatus"]; + status.accessibilityLabel=[header.title stringByAppendingString:@":已旁路,参数仍可调整"]; + status.toolTip=@"参数仍可调整;点击左侧眼睛使本组生效"; + [card addSubview:status]; NSButton *reset=DYButton(@"↺",self,@selector(resetSection:)); reset.tag=index; reset.bordered=NO; reset.toolTip=@"还原本组"; reset.accessibilityLabel=[section[@"title"] stringByAppendingString:@"还原"]; @@ -575,7 +584,7 @@ static NSImage *DYWheelImage(void) { } for(NSView *row in body)if(![ordered containsObject:row])row.hidden=YES;body=ordered; } - NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@([key isEqual:@"skin"])}]; + NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"status":status,@"reset":reset,@"body":body,@"collapsed":@([key isEqual:@"skin"])}]; if([key isEqual:@"look"]){NSButton *add=DYButton(@"+",self,@selector(addLook:));add.bordered=NO;add.font=[NSFont boldSystemFontOfSize:20];add.accessibilityLabel=@"添加风格 LUT";[card addSubview:add];record[@"add"]=add;} [_cards addObject:record]; index++; @@ -623,13 +632,19 @@ static NSImage *DYWheelImage(void) { DYCard *card=c[@"view"];BOOL collapsed=[c[@"collapsed"]boolValue];NSString *key=c[@"section"][@"key"]; NSArray *body=c[@"body"];CGFloat contentHeight=0; for(NSView *row in body)if([self showRow:row section:key])contentHeight+=[self heightForRow:row]; - card.frame=NSMakeRect(16,y,cw,43+(collapsed?0:contentHeight+8));y+=card.frame.size.height+12; [c[@"enabled"]setFrame:NSMakeRect(12,12,20,20)]; CGFloat titleWidth=MIN(cw-104,MAX(80,[[(NSButton *)c[@"header"]title]sizeWithAttributes:@{NSFontAttributeName:[NSFont boldSystemFontOfSize:12]}].width+22)); [c[@"header"]setFrame:NSMakeRect(42,8,titleWidth,28)]; + NSTextField *status=c[@"status"]; + CGFloat statusX=42+titleWidth+8,statusRight=cw-(c[@"add"]?70:42); + CGFloat statusWidth=ceil([status.stringValue sizeWithAttributes:@{NSFontAttributeName:status.font}].width)+2; + BOOL statusOnSecondLine=!status.hidden&&statusRight-statusX=.5?NSControlStateValueOn:NSControlStateValueOff]; [c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:v>=.5?@"eye":@"eye.slash" accessibilityDescription:v>=.5?@"启用本组":@"旁路本组"]]; - for(NSView *row in c[@"body"])row.alphaValue=v>=.5?1:.45; + [c[@"enabled"]setToolTip:v>=.5?@"点击旁路本组;参数仍可调整":@"已旁路,参数仍可调整;点击启用本组"]; + [c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]]; + [c[@"status"]setHidden:!pid||v>=.5]; + // Bypass affects rendering, not editability. Keep editable rows legible. + for(NSView *row in c[@"body"])row.alphaValue=1; } DYAssetState *assets=DYReadAssets(_manager,t); for(NSString *key in _assetButtons) { @@ -709,7 +728,7 @@ static NSImage *DYWheelImage(void) { NSString *text=[sender.stringValue stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceCharacterSet];BOOL percent=[text hasSuffix:@"%"]; if(percent)text=[text substringToIndex:text.length-1];scanner=[NSScanner scannerWithString:text]; if(![scanner scanDouble:&v]||!scanner.isAtEnd||!std::isfinite(v)){NSBeep();[self refresh];return;} - if([d[@"key"]hasSuffix:@"Strength"])v/=100.; + if(DYStrengthUsesUnitRange(d))v/=100.; } else v=sender.doubleValue; } v=fmax([d[@"min"] doubleValue],fmin([d[@"max"] doubleValue],v)); diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index 4ea1e05..e8413c3 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.1.1 + 1.1.2 CFBundleVersion - 7 + 8 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index e70f9ac..114b6de 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.1.1 + 1.1.2 CFBundleVersion - 7 + 8 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright