fix: keep bypassed group controls legible and correct skin strength percentage in 1.1.2
这个提交包含在:
1 父节点
09321ed524
当前提交
3645119118
3 个文件已更改
+29
-10
没有与搜索条件相匹配的文件
+25
-6
@@ -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<statusWidth;
|
||||
CGFloat headerHeight=statusOnSecondLine?62:43;
|
||||
status.frame=statusOnSecondLine?NSMakeRect(42,38,cw-84,17):NSMakeRect(statusX,15,MAX(0,statusRight-statusX),17);
|
||||
card.frame=NSMakeRect(16,y,cw,headerHeight+(collapsed?0:contentHeight+8));y+=card.frame.size.height+12;
|
||||
[c[@"reset"]setFrame:NSMakeRect(cw-36,10,24,24)];
|
||||
[c[@"add"]setFrame:NSMakeRect(cw-64,10,24,24)];[c[@"add"]setEnabled:_visibleLooks<5];
|
||||
CGFloat rowY=43;
|
||||
CGFloat rowY=headerHeight;
|
||||
for(NSView *row in body) {
|
||||
BOOL show=!collapsed&&[self showRow:row section:key];row.hidden=!show;if(!show)continue;
|
||||
CGFloat rh=[self heightForRow:row];row.frame=NSMakeRect(12,rowY,cw-24,rh-1);rowY+=rh;
|
||||
@@ -681,7 +696,11 @@ static NSImage *DYWheelImage(void) {
|
||||
double v=1;if(pid)[get getFloatValue:&v fromParameter:pid.unsignedIntValue atTime:t];
|
||||
[c[@"enabled"] setState:v>=.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));
|
||||
|
||||
+2
-2
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.1.1</string>
|
||||
<string>1.1.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>7</string>
|
||||
<string>8</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.1.1</string>
|
||||
<string>1.1.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>7</string>
|
||||
<string>8</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户