diff --git a/research/MaskFolding1.4.3.md b/research/MaskFolding1.4.3.md new file mode 100644 index 0000000..8f536b8 --- /dev/null +++ b/research/MaskFolding1.4.3.md @@ -0,0 +1,11 @@ +# 1.4.3(33)蒙版面板随模块折叠 + +用户报告模块收起后蒙版面板仍显示。正式1.4.2(31)中已复现:蜘蛛盘标题为折叠状态,蒙版类型、几何参数与跟踪控件仍出现在检视器。当前完整预设(含286个轨迹键)已先保存到本机验收缓存。 + +原因是DYInspector布局在内容高度累计和行显示两处,均把DYToolMaskPanel排除在collapsed条件之外。两处统一遵循模块折叠状态,折叠后隐藏整个蒙版面板并去掉占用高度;展开后恢复已有蒙版控件。原模块和新增独立层使用同一布局代码。 + +用户补充希望折叠后能辨认有蒙版的层:标题栏蒙版图标增加数量徽标(1–16),无蒙版时隐藏,启停蒙版都计入已添加数量。徽标不拦截鼠标,蒙版按钮的提示及辅助说明同步数量。五套主题从现有配色取色,展开和折叠时均保留标记。32版仅折叠修复候选完成公证安装,未发布;33版包含本次补充。 + +本次只改布局、标题栏状态显示和版本元数据,不改变启用、调色、蒙版几何、轨迹、合成方式或渲染代码。沿用现有原生检查,在正式签名公证安装后验证原模块及新增层的折叠、展开和状态保留;不为这次布局修复另写重复单元测试。 + +正式宿主和交付结果见 verification/HostMaskFolding1.4.3.json、Delivery.json、Package.json、Release.json 对应版本记录。用户预设和项目快照保留在本机,不进入Git。 diff --git a/大鱼调色/Plugin/DYInspector.mm b/大鱼调色/Plugin/DYInspector.mm index 17c3873..686aa8f 100644 --- a/大鱼调色/Plugin/DYInspector.mm +++ b/大鱼调色/Plugin/DYInspector.mm @@ -26,6 +26,26 @@ static NSButton *DYButton(NSString *title,id target,SEL action) { b.bezelStyle=NSBezelStyleRounded; b.font=[NSFont systemFontOfSize:11]; b.contentTintColor=DYAccent(); return b; } +// Header status stays visible while the body is folded and never intercepts clicks. +@interface DYMaskCountBadge : NSView +@property(nonatomic) NSUInteger count; +@end +@implementation DYMaskCountBadge +- (void)setCount:(NSUInteger)count {_count=count;self.hidden=count==0;[self setNeedsDisplay:YES];} +- (NSView*)hitTest:(NSPoint)point {return nil;} +- (BOOL)isAccessibilityElement {return YES;} +- (NSString*)accessibilityRole {return NSAccessibilityStaticTextRole;} +- (id)accessibilityValue {return [NSString stringWithFormat:@"%lu 个蒙版",(unsigned long)_count];} +- (void)drawRect:(NSRect)dirtyRect { + if(!_count)return;NSRect frame=NSInsetRect(self.bounds,.6,.6); + NSBezierPath *pill=[NSBezierPath bezierPathWithRoundedRect:frame xRadius:6 yRadius:6]; + [DYThemeColor(@"field") setFill];[pill fill];[DYAccent() setStroke];pill.lineWidth=1.2;[pill stroke]; + NSString *text=[NSString stringWithFormat:@"%lu",(unsigned long)_count]; + NSDictionary *attributes=@{NSFontAttributeName:[NSFont monospacedDigitSystemFontOfSize:10.5 weight:NSFontWeightBold],NSForegroundColorAttributeName:DYInk()}; + NSSize size=[text sizeWithAttributes:attributes];[text drawAtPoint:NSMakePoint(NSMidX(self.bounds)-size.width/2,NSMidY(self.bounds)-size.height/2) withAttributes:attributes]; +} +@end + static BOOL DYStrengthUsesUnitRange(NSDictionary *d) { return [d[@"key"] hasSuffix:@"Strength"] && [d[@"max"] doubleValue]<=1; } @@ -624,6 +644,7 @@ static NSImage *DYWheelImage(void) { NSString *nodeID=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:key]; DYToolMaskPanel *maskPanel=[[[DYToolMaskPanel alloc]initWithManager:host nodeID:nodeID]autorelease];[card addSubview:maskPanel];[body insertObject:maskPanel atIndex:0];record[@"maskPanel"]=maskPanel; NSButton *mask=DYButton(@"",self,@selector(toolMask:));mask.tag=index;mask.bordered=NO;mask.image=[NSImage imageWithSystemSymbolName:@"circle.dashed.inset.filled" accessibilityDescription:@"添加蒙版"];mask.toolTip=@"添加本工具的独立蒙版";mask.accessibilityLabel=[section[@"title"]stringByAppendingString:@"添加蒙版"];[card addSubview:mask];record[@"maskButton"]=mask; + DYMaskCountBadge *maskBadge=[[[DYMaskCountBadge alloc]initWithFrame:NSZeroRect]autorelease];maskBadge.hidden=YES;maskBadge.accessibilityLabel=[section[@"title"] stringByAppendingString:@"蒙版数量"];[card addSubview:maskBadge];record[@"maskBadge"]=maskBadge; NSButton *repeat=DYButton(@"",self,@selector(repeatTool:));repeat.tag=index;repeat.bordered=NO;repeat.image=[NSImage imageWithSystemSymbolName:@"plus.square.on.square" accessibilityDescription:@"再加一层"];repeat.toolTip=@"紧接当前工具插入一层初始化工具";repeat.accessibilityLabel=[section[@"title"]stringByAppendingString:@"再加一层"];[card addSubview:repeat];record[@"repeatButton"]=repeat; if(_embedded){NSButton *remove=DYButton(@"删除此层",self,@selector(removeTool:));remove.identifier=@"removeTool";[card addSubview:remove];[body addObject:remove];} [_cards addObject:record]; @@ -680,7 +701,7 @@ static NSImage *DYWheelImage(void) { CGFloat headerHeight=43; card.frame=NSMakeRect(16,y,cw,headerHeight+(contentHeight>0?contentHeight+8:0));y+=card.frame.size.height+12; [c[@"reset"]setFrame:NSMakeRect(cw-34,10,24,24)]; - [c[@"repeatButton"]setFrame:NSMakeRect(cw-62,10,24,24)];[c[@"maskButton"]setFrame:NSMakeRect(cw-90,10,24,24)]; + [c[@"repeatButton"]setFrame:NSMakeRect(cw-62,10,24,24)];[c[@"maskButton"]setFrame:NSMakeRect(cw-90,10,24,24)];[c[@"maskBadge"]setFrame:NSMakeRect(cw-83,3,18,16)]; [c[@"add"]setFrame:NSMakeRect(cw-33,headerHeight+contentHeight-28,20,24)];[c[@"add"]setEnabled:_visibleLooks<5];[c[@"add"]setHidden:collapsed]; CGFloat rowY=headerHeight; for(NSView *row in body) { @@ -753,7 +774,12 @@ static NSImage *DYWheelImage(void) { [c[@"enabled"]setToolTip:enabled?@"停用本组,保留参数和展开状态":@"启用本组,保留展开状态"];[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]]; for(NSView *row in c[@"body"])row.alphaValue=enabled?1:.45; } - id maskHost=_embedded?[(DYToolManager*)_manager host]:_manager;NSDictionary *tools=DYReadTools(maskHost,t).document;for(NSDictionary *card in _cards)[card[@"maskPanel"]refreshWithDocument:tools time:t]; + id maskHost=_embedded?[(DYToolManager*)_manager host]:_manager;NSDictionary *tools=DYReadTools(maskHost,t).document;for(NSDictionary *card in _cards){ + [card[@"maskPanel"]refreshWithDocument:tools time:t]; + NSString *nodeID=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:card[@"section"][@"key"]];NSUInteger count=[DYMasksForTool(tools,nodeID) count]; + [(DYMaskCountBadge*)card[@"maskBadge"]setCount:count];NSString *hint=count?[NSString stringWithFormat:@"已有 %lu 个蒙版;点击添加独立蒙版",(unsigned long)count]:@"添加本工具的独立蒙版"; + [card[@"maskButton"]setToolTip:hint];[card[@"maskButton"]setAccessibilityHelp:hint]; + } DYAssetState *assets=DYReadAssets(_manager,t);[_spiderPanel setMesh:assets.spiderMesh linked:assets.spiderLinked]; double profile=0,configured=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];[get getFloatValue:&configured fromParameter:2236 atTime:t]; DYInspectorToken *oldToken=nil;[get getCustomParameterValue:&oldToken fromParameter:DYInspectorParameterID atTime:t]; diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index a5d94af..e10f818 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.4.3 CFBundleVersion - 32 + 33 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index c29de0c..bad9938 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.4.3 CFBundleVersion - 32 + 33 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright