Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
feat(ui): add individual parameter slider reset buttons
Veyra Goal Agent412a19f6ef53
diff --git a/CMakeLists.txt b/CMakeLists.txtindex 56313e6a..8934e6ab 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -835,6 +835,10 @@ if(VEYRA_FFMPEG_ROOT AND EXISTS "${VEYRA_FFMPEG_ROOT}/include/libavformat/avformtarget_link_libraries(veyra_hdr_color_tests PRIVATE veyra_engine)add_executable(veyra WIN32 apps/veyra/main.cpp apps/veyra/ui/AppShell.cpp apps/veyra/ui/CapturePanel.cpp apps/veyra/ui/SubtitleOverlay.cpp apps/veyra/SettingsWindow.cpp apps/veyra/TelemetryWindow.cpp)target_sources(veyra PRIVATE apps/veyra/ui/ScreenCapturePanel.cpp)+ add_executable(veyra_slider_reset_tests tests/integration/SliderResetTests.cpp apps/veyra/SettingsWindow.cpp)+ target_compile_features(veyra_slider_reset_tests PRIVATE cxx_std_20)+ target_compile_options(veyra_slider_reset_tests PRIVATE /utf-8)+ target_link_libraries(veyra_slider_reset_tests PRIVATE veyra_engine comctl32 comdlg32 shell32)if(VEYRA_ENABLE_REMOTEPLAY)add_executable(veyra_ps5_hw_image_tests tests/integration/Ps5HardwareImageTests.cpp)add_executable(veyra_ps5_quality_tests tests/integration/Ps5SourceQualityTests.cpp)diff --git a/apps/veyra/SettingsWindow.cpp b/apps/veyra/SettingsWindow.cppindex 738d5e7c..5d024519 100644--- a/apps/veyra/SettingsWindow.cpp+++ b/apps/veyra/SettingsWindow.cpp@@ -39,6 +39,14 @@ constexpr auto smoothMotionHelp=L"只用 Smooth Motion\n"L"• 驱动额外延迟未测量,音画同步需实测。截图、导出不含驱动生成的帧;直播录制是否捕获到它们也需另测。\n"L"• 功能可用性以 NVIDIA App、显卡和驱动支持为准。";struct Item{HWND h;int page,x,y,w,height;bool hidden=false;};std::vector<Item> items;+struct RowReset {+ int slider,label,value;+ std::function<double(const engine::EnhancementSettings&)> get;+ std::function<void(engine::EnhancementSettings&)> reset;+ std::wstring tip;+};+std::map<int,RowReset> rowResets;+void syncRowResets();HWND item(int id){for(auto& entry:items)if(GetDlgCtrlID(entry.h)==id)return entry.h;return nullptr;}LRESULT send(int id,UINT message,WPARAM w=0,LPARAM l=0){return SendMessageW(item(id),message,w,l);}void putText(int id,const wchar_t* value){setText(item(id),value);}@@ -357,6 +365,7 @@ void syncColorControls(){for(int section=0;section<kColorSections;++section)if(auto eye=item(colorSectionEyeId(section)))InvalidateRect(eye,nullptr,FALSE);for(int zone=0;zone<engine::kColorGradingZones;++zone)if(auto wheel=item(colorWheelId(zone)))InvalidateRect(wheel,nullptr,FALSE);syncingColour=false;+ syncRowResets();}bool applyColour(const engine::ColorSettings& colour,bool autoEnable,bool record=true){auto settings=enhancementEnabled?controller->snapshot().desired:configuredSettings;@@ -1099,6 +1108,13 @@ void arrange(){const int sticky=128,viewport=std::max(1,height-sticky);contentHeight=0;// The child still has its previous size until SetWindowPos below.if(page==2)layoutColorPage(width);+ for(const auto& [id,row]:rowResets){+ auto findItem=[&](int control)->Item&{return *std::find_if(items.begin(),items.end(),[&](const Item& entry){return GetDlgCtrlID(entry.h)==control;});};+ auto& value=findItem(row.value);auto& reset=findItem(id);auto& label=findItem(row.label);+ reset.x=width-40;reset.y=value.y;reset.hidden=value.hidden;+ value.x=std::max(100,width-126);value.w=80;+ label.w=std::max(1,value.x-label.x-8);+ }int helpHeight=0;if(smoothMotionHelpExpanded){auto dc=GetDC(window);auto old=SelectObject(dc,font);RECT textRect{0,0,dip(window,std::max(1,width-24)),0};DrawTextW(dc,smoothMotionHelp,-1,&textRect,DT_CALCRECT|DT_WORDBREAK|DT_NOPREFIX);SelectObject(dc,old);ReleaseDC(window,dc);helpHeight=MulDiv(textRect.bottom,96,layoutDpi(window))+16;}const auto helpOffset=[&](const Item& entry){const auto id=GetDlgCtrlID(entry.h);return entry.page==1&&(id==1114||id==205||id==1110||id==240||id==241||id==242||id==1150)?helpHeight:0;};@@ -1116,7 +1132,66 @@ void arrange(){HWND add(const wchar_t* cls,const wchar_t* text,int id,DWORD style,int group,int x,int y,int width,int height){auto h=CreateWindowExW(0,cls,text,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|style,0,0,1,1,group==-1?window:body,reinterpret_cast<HMENU>(INT_PTR(id)),GetModuleHandleW(nullptr),nullptr);SendMessageW(h,WM_SETFONT,WPARAM(font),TRUE);themeControl(h);if(group!=-1)SetWindowSubclass(h,scrollOnly,950,0);items.push_back({h,group,x,y,width,height});return h;}void button(const wchar_t* title,int id,int group,int x,int y,int width=-1){add(L"BUTTON",title,id,BS_PUSHBUTTON|WS_TABSTOP,group,x,y,width,36);}void combo(int id,int group,int y,std::initializer_list<const wchar_t*> names){auto h=add(L"COMBOBOX",L"",id,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP,group,12,y,-1,200);for(auto name:names)SendMessageW(h,CB_ADDSTRING,0,LPARAM(name));}+void syncRowResets(){+ if(!controller)return;+ const auto settings=enhancementEnabled?controller->snapshot().desired:configuredSettings;+ const engine::EnhancementSettings defaults{};+ for(const auto& [id,row]:rowResets){+ const bool changed=std::abs(row.get(settings)-row.get(defaults))>0.00001;+ if(bool(IsWindowEnabled(item(id)))!=changed)EnableWindow(item(id),changed);+ }+}+void createRowResets(){+ const auto addReset=[&](int slider,int label,int value,auto access,const ColorParam* colourParam=nullptr){+ const int id=2000+slider;+ RowReset row{slider,label,value,+ [access](const engine::EnhancementSettings& s){auto copy=s;return double(access(copy));},+ [access](engine::EnhancementSettings& s){engine::EnhancementSettings defaults{};access(s)=access(defaults);}};+ if(colourParam){+ const auto param=*colourParam;+ row.get=[param](const auto& s){return double(param.value(s.color));};+ row.reset=[param](auto& s){param.set(s.color,param.value(engine::ColorSettings{}));};+ }+ wchar_t name[128]{};GetWindowTextW(item(label),name,128);+ if(slider==622)wcscpy_s(name,L"羽化");+ row.tip=std::format(L"还原{} · 默认 {:g}",name,row.get(engine::EnhancementSettings{}));+ auto& stored=rowResets.emplace(id,std::move(row)).first->second;+ const auto valueItem=*std::find_if(items.begin(),items.end(),[&](const Item& entry){return entry.h==item(value);});+ auto h=add(L"BUTTON",stored.tip.c_str(),id,BS_PUSHBUTTON|WS_TABSTOP,valueItem.page,0,valueItem.y,28,28);+ icon(h,Icon::Reset);ghost(h);SetPropW(h,L"veyra.reset",HANDLE(1));+ SetPropW(h,L"veyra.tip",HANDLE(stored.tip.c_str()));+ SetWindowLongPtrW(item(label),GWL_STYLE,GetWindowLongPtrW(item(label),GWL_STYLE)|SS_ENDELLIPSIS);+ };+ addReset(600,1000,100,[](auto& s)->auto&{return s.model.intensity;});+ addReset(601,1001,101,[](auto& s)->auto&{return s.model.tone;});+ addReset(602,1002,102,[](auto& s)->auto&{return s.model.structure;});+ addReset(603,1003,103,[](auto& s)->auto&{return s.model.skin;});+ addReset(607,1007,107,[](auto& s)->auto&{return s.residual.total;});+ addReset(608,1008,108,[](auto& s)->auto&{return s.residual.darken;});+ addReset(609,1009,109,[](auto& s)->auto&{return s.residual.brighten;});+ addReset(610,1010,110,[](auto& s)->auto&{return s.residual.color;});+ addReset(611,1011,111,[](auto& s)->auto&{return s.residual.luminance;});+ addReset(622,1123,222,[](auto& s)->auto&{return s.protection.featherPixels;});+ addReset(631,1141,1131,[](auto& s)->auto&{return s.videoHdr.contrast;});+ addReset(632,1142,1132,[](auto& s)->auto&{return s.videoHdr.saturation;});+ addReset(633,1143,1133,[](auto& s)->auto&{return s.videoHdr.middleGray;});+ addReset(634,1144,1134,[](auto& s)->auto&{return s.videoHdr.peakNits;});+ for(size_t i=0;i<colorParams.size();++i){+ // Colour arrays and scalars share the same field descriptor as editing.+ addReset(colorSliderId(int(i)),colorLabelId(int(i)),colorEditId(int(i)),[](auto& s)->auto&{return s.color.exposure;},&colorParams[i]);+ }+}LRESULT CALLBACK proc(HWND h,UINT msg,WPARAM wp,LPARAM lp){+ if(msg==WM_COMMAND&&!populating&&HIWORD(wp)==BN_CLICKED){+ if(const auto found=rowResets.find(LOWORD(wp));found!=rowResets.end()){+ auto settings=enhancementEnabled?controller->snapshot().desired:configuredSettings;+ found->second.reset(settings);+ if(found->second.slider>=colorSliderId(0))applyColour(settings.color,false);+ else submit(settings);+ populate(enhancementEnabled?controller->snapshot().desired:configuredSettings);+ return 0;+ }+ }if(msg==WM_COMMAND&&!populating&&((LOWORD(wp)==240&&HIWORD(wp)==BN_CLICKED)||((LOWORD(wp)==241||LOWORD(wp)==242)&&HIWORD(wp)==CBN_SELCHANGE))){auto setting=controller->snapshot().presentation;setting.enabled=checked(240)==BST_CHECKED;setting.mode=engine::PacingMode(send(241,CB_GETCURSEL));setting.display=engine::DisplaySync(send(242,CB_GETCURSEL));@@ -1564,6 +1639,7 @@ case WM_CREATE:{window=h;font=makeFont(h);items.clear();displayedBackendWarning.auto slider=add(TRACKBAR_CLASSW,L"",631+i,TBS_HORZ|TBS_NOTICKS|WS_TABSTOP,0,12,y+26,-1,24);SendMessageW(slider,TBM_SETRANGE,TRUE,MAKELPARAM(hdrMin[i],hdrMax[i]));}+ createRowResets();loadStore();populate(controller->snapshot().desired);message(store.error());SetTimer(h,1,250,nullptr);arrange();// Layout evidence for UI work: VEYRA_DUMP_SETTINGS_LAYOUT=1 prints the// resolved position of every control once, in DIP units.@@ -1616,7 +1692,7 @@ case WM_TIMER:{auto s=controller->snapshot();putText(1150,s.presentationStatus.cs.videoHdrStatus.empty()?L"等待预览状态":s.videoHdrStatus.c_str();putText(1145,hdrStatus);return 0;}-case WM_DESTROY:KillTimer(h,1);DeleteObject(font);window=nullptr;body=nullptr;items.clear();return 0;+case WM_DESTROY:KillTimer(h,1);DeleteObject(font);window=nullptr;body=nullptr;items.clear();rowResets.clear();return 0;}return DefWindowProcW(h,msg,wp,lp);}}engine::EnhancementSettings defaultSettings(){loadStore();return store.defaultSettings();}diff --git a/apps/veyra/ui/LucideIcons.h b/apps/veyra/ui/LucideIcons.hindex 486724ed..6366a60f 100644--- a/apps/veyra/ui/LucideIcons.h+++ b/apps/veyra/ui/LucideIcons.h@@ -3,7 +3,7 @@#pragma once#include "GlassMaterial.h"namespace veyra::ui {-enum class Icon { None,Play,Pause,Stop,Volume,Muted,Fullscreen,Video,Capture,Image,Subtitle,Minimize,Maximize,Close,Back,Settings,Recent,Enhance,Upscale,PanelOpen,PanelClose,Check,Chevron,Load,Type,ScreenCapture };+enum class Icon { None,Play,Pause,Stop,Volume,Muted,Fullscreen,Video,Capture,Image,Subtitle,Minimize,Maximize,Close,Back,Settings,Recent,Enhance,Upscale,PanelOpen,PanelClose,Check,Chevron,Load,Type,ScreenCapture,Reset };inline void drawIcon(HDC dc,Icon icon,float x,float y,float size,COLORREF c){using namespace Gdiplus; AlphaGraphics drawing(dc);auto& g=drawing.get();g.SetSmoothingMode(SmoothingModeAntiAlias);g.TranslateTransform(x-size/2,y-size/2);g.ScaleTransform(size/24,size/24);@@ -402,6 +402,17 @@ p.AddLine(2.0000000f,8.0000000f,22.0000000f,8.0000000f);p.StartFigure();p.AddLine(6.0000000f,4.0000000f,6.0000000f,8.0000000f);break;+case Icon::Reset: // rotate-ccw.svg+p.StartFigure();+p.AddBezier(3.0000000f,12.0000000f,3.0000000f,16.9705627f,7.0294373f,21.0000000f,12.0000000f,21.0000000f);+p.AddBezier(12.0000000f,21.0000000f,16.9705627f,21.0000000f,21.0000000f,16.9705627f,21.0000000f,12.0000000f);+p.AddBezier(21.0000000f,12.0000000f,21.0000000f,7.0294373f,16.9705627f,3.0000000f,12.0000000f,3.0000000f);+p.AddBezier(12.0000000f,3.0000000f,9.4839519f,3.0094651f,7.0689690f,3.9912237f,5.2600000f,5.7400000f);+p.AddLine(5.2600000f,5.7400000f,3.0000000f,8.0000000f);+p.StartFigure();+p.AddLine(3.0000000f,3.0000000f,3.0000000f,8.0000000f);+p.AddLine(3.0000000f,8.0000000f,8.0000000f,8.0000000f);+break;default: return;}g.DrawPath(&pen,&p);}}diff --git a/apps/veyra/ui/Theme.h b/apps/veyra/ui/Theme.hindex 310d71a5..2b0deb5f 100644--- a/apps/veyra/ui/Theme.h+++ b/apps/veyra/ui/Theme.h@@ -88,7 +88,7 @@ inline LRESULT CALLBACK buttonPaint(HWND h,UINT m,WPARAM w,LPARAM l,UINT_PTR,DWOconst bool marked=GetPropW(h,L"veyra.accent")!=nullptr,selected=GetPropW(h,L"veyra.selected")!=nullptr,hover=GetPropW(h,L"veyra.hover")!=nullptr,down=SendMessageW(h,BM_GETSTATE,0,0)&BST_PUSHED,check=SendMessageW(h,BM_GETCHECK,0,0)==BST_CHECKED,ghost=GetPropW(h,L"veyra.ghost")!=nullptr;const auto ico=static_cast<Icon>(INT_PTR(GetPropW(h,L"veyra.icon")));bool caption=GetPropW(h,L"veyra.caption")!=nullptr;COLORREF fill=marked?accent:(down||selected?line:hover?raised:surface(h));if(glassBackdrop(h)&&!marked){if(down||selected||hover)translucentRound(dc,r,down?42:selected?31:18,dip(h,8));}else if(!ghost||hover||selected||marked)roundRect(dc,r,fill,ico==Icon::Play||ico==Icon::Pause?std::min(r.right,r.bottom)/2:dip(h,8));- wchar_t value[512]{};GetWindowTextW(h,value,512);auto f=reinterpret_cast<HFONT>(SendMessageW(h,WM_GETFONT,0,0));auto old=SelectObject(dc,f);SetBkMode(dc,TRANSPARENT);COLORREF ink=!IsWindowEnabled(h)?RGB(90,96,103):marked?RGB(24,31,36):(selected||check)?accent:hover?textColor:secondary;SetTextColor(dc,ink);+ wchar_t value[512]{};GetWindowTextW(h,value,512);auto f=reinterpret_cast<HFONT>(SendMessageW(h,WM_GETFONT,0,0));auto old=SelectObject(dc,f);SetBkMode(dc,TRANSPARENT);COLORREF ink=!IsWindowEnabled(h)?RGB(90,96,103):marked?RGB(24,31,36):(selected||check||(hover&&GetPropW(h,L"veyra.reset")))?accent:hover?textColor:secondary;SetTextColor(dc,ink);if(ico!=Icon::None){drawIcon(dc,ico,caption?float(dip(h,18)):r.right/2.f,r.bottom/2.f,float(dip(h,ico==Icon::Play||ico==Icon::Pause?22:17)),ink);if(caption){r.left=dip(h,34);glassText(dc,value,-1,&r,DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS);}}else if((GetWindowLongPtrW(h,GWL_STYLE)&BS_TYPEMASK)==BS_AUTOCHECKBOX){RECT toggle{r.right-dip(h,40),r.bottom/2-dip(h,8),r.right-dip(h,10),r.bottom/2+dip(h,8)};roundRect(dc,toggle,check?accent:line,dip(h,8));RECT knob{toggle.left+dip(h,check?16:3),toggle.top+dip(h,3),toggle.left+dip(h,check?26:13),toggle.top+dip(h,13)};roundRect(dc,knob,check?panel:secondary,dip(h,5));r.left=dip(h,12);r.right-=dip(h,46);glassText(dc,value,-1,&r,DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS);}else glassText(dc,value,-1,&r,DT_CENTER|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS);if(GetFocus()==h&&!(SendMessageW(h,WM_QUERYUISTATE,0,0)&UISF_HIDEFOCUS)){RECT outline{};GetClientRect(h,&outline);InflateRect(&outline,-3,-3);AlphaGraphics focusDrawing(dc);auto& focus=focusDrawing.get();focus.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);Gdiplus::GraphicsPath path;rounded(path,{float(outline.left),float(outline.top),float(outline.right-outline.left),float(outline.bottom-outline.top)},float(dip(h,6)));Gdiplus::Pen stroke(color(accent,145),1);focus.DrawPath(&stroke,&path);}SelectObject(dc,old);return 0;}diff --git a/assets/icons/lucide/manifest.json b/assets/icons/lucide/manifest.jsonindex 55f8a7d7..da0be103 100644--- a/assets/icons/lucide/manifest.json+++ b/assets/icons/lucide/manifest.json@@ -20,6 +20,7 @@"panel-right-open.svg": "7cea098473914c767e3a17561626df816a886de878cc943da79ae95bf726c9f0","pause.svg": "f122ec4ea7f5693a0b1baafa9c708b53980dc87b4aacb297c6e6f71c1a4c115c","play.svg": "d7c34786135922a92b6896f6c2384ceeb0346afbf6041dc79982011411409833",+ "rotate-ccw.svg": "622685386ab4017eabfde01cd74550a20b1924df233b353f73b6b155371f2afd","scan.svg": "c77f0e634b2451a14a262a59b61d75bbcea3994b16eeba1f5753e86b33282a4d","sliders-horizontal.svg": "e43a00e5eb684e6cbb61083bed2528d7a3fa5f265693eb2b5f314cd432aa65f4","sparkles.svg": "f5499f33f09d7158151e9bd2ec0faf79ff8fb57292f84fdd7286d96d0f0424d8",diff --git a/assets/icons/lucide/rotate-ccw.svg b/assets/icons/lucide/rotate-ccw.svgnew file mode 100644index 00000000..eb0fe349--- /dev/null+++ b/assets/icons/lucide/rotate-ccw.svg@@ -0,0 +1,14 @@+<svg+ xmlns="http://www.w3.org/2000/svg"+ width="24"+ height="24"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+>+ <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />+ <path d="M3 3v5h5" />+</svg>diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex a26f9598..eb698a51 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -4527,3 +4527,19 @@ Blackwell 上会改变一条已经正常工作的路径,无法区分"补丁生用户授权本轮修复、整合 main、GitHub 发布及新群/HDR 对比图片公开。AppShell 全屏切换先 TTM_POP,再按 full 状态 TTM_ACTIVATE,退出恢复正常提示。更新中英文 README、1.4.2 notes、组件与对应源码说明、RELEASE_SUPPORT;打包正式纳入已授权 TrueHDR,附 README 图片与窗口采集 MIT 许可。具体命令与最终状态见 RELEASE_1.4.2_EXECUTION.md。产物统一在 E:/项目/Veyra/releases/1.4.2、build/screen-capture-20260919,以及 logs/tests/tmp/release-1.4.2-20260919。未覆盖上一轮内测包。+# 2026-09-19 参数滑杆单项还原(方案一)++用户选择数值右侧固定还原图标。分支 `codex/slider-reset-20260919` 从字幕弹窗修复 `4bce05e` 创建,未合并、推送或发布。++- `SettingsWindow.cpp` 为调色、NR、剔除区羽化和 RTX Video HDR 参数滑杆增加 28 DIP 独立按钮;读取 `EnhancementSettings{}` / `ColorSettings{}` 的实际默认值,只改对应字段,保留开关和其他参数。调色使用现有提交与撤销路径;提交失败保留原设置。默认态禁用,修改后启用,提示显示参数和默认值。+- 数值和按钮固定右对齐,标签超长省略,折叠状态跟随参数行。`Theme.h` 增加还原按钮橙色悬停;新增 Lucide rotate-ccw 原始 SVG,由现有固定提交生成器更新图标和 manifest,许可证沿用 assets/icons/lucide/LICENSE。+- 增加 `veyra_slider_reset_tests` 实际 Win32 控件测试:NR、羽化、HDR、曝光、非零混合/LUT 默认值;其他字段及开关不变;调色撤销;拒绝提交;按钮状态;280/328/420 宽度及折叠隐藏。++实际命令与证据:++1. `python scripts/generate-lucide-icons.py`,PYTHONPATH 指向 `E:/项目/Veyra/deps/fonttools-4.64.0`,生成 26 个图标。+2. `scripts/build-isolated.ps1 -Root . -BuildDirectory E:/项目/Veyra/build/slider-reset-20260919 -DependencyCache E:/项目/Veyra/build/frame-pacing-20260918/CMakeCache.txt -TempDirectory E:/项目/Veyra/tmp/slider-reset-20260919 -DisplayVersion 1.4.2 -Targets veyra,veyra_slider_reset_tests` 通过;另构建 `veyra_popup_selector_tests`。+3. `veyra_slider_reset_tests.exe --visual` 退出 0,全部断言通过;computer-use 实际点击曝光还原,曝光 2.00 -> 0.00,对比度保留 17.00,截图确认图标/数值无重叠。初次测试缺少 GDI+ 初始化发生崩溃,补齐测试初始化后通过;视觉测试宿主增加 WS_CLIPCHILDREN,消除宿主背景覆盖子控件。+4. `veyra_popup_selector_tests.exe` 退出 0,包含此前字幕弹窗鼠标/键盘案例;`scripts/run-short-test.ps1 ... --smoke-empty --smoke-seconds 5` 主程序退出 0。++日志及截图:`E:/项目/Veyra/logs/slider-reset-20260919/`(final-build.log、reset-test.log、popup-test.log、app-smoke.log、reset-after-click.png)。临时文件:`E:/项目/Veyra/tmp/slider-reset-20260919/`。未打包。此次为设置 UI 修改,未执行 NVIDIA Create/Evaluate、视频画质或实卡补帧测试,不据此宣称处理链验收。diff --git a/scripts/generate-lucide-icons.py b/scripts/generate-lucide-icons.pyindex a325af61..6799abd4 100644--- a/scripts/generate-lucide-icons.py+++ b/scripts/generate-lucide-icons.py@@ -20,7 +20,7 @@ ICONS = dict(Play="play", Pause="pause", Stop="square", Volume="volume-2",Settings="sliders-horizontal", Recent="clock", Enhance="sparkles",Upscale="scan", PanelOpen="panel-right-open", PanelClose="panel-right-close",Check="check", Chevron="chevron-down", Load="file-plus", Type="type",- ScreenCapture="app-window")+ ScreenCapture="app-window", Reset="rotate-ccw")DEST = ROOT / "assets/icons/lucide"DEST.mkdir(parents=True, exist_ok=True)manifest = {"repository": "https://github.com/lucide-icons/lucide", "revision": REVISION,diff --git a/tests/integration/SliderResetTests.cpp b/tests/integration/SliderResetTests.cppnew file mode 100644index 00000000..611617f8--- /dev/null+++ b/tests/integration/SliderResetTests.cpp@@ -0,0 +1,58 @@+#include "../../apps/veyra/SettingsWindow.h"+#include "../../apps/veyra/ui/Theme.h"+#include <iostream>+#include <stdexcept>++void require(bool value,const char* why){if(!value)throw std::runtime_error(why);}+int wmain(int argc,wchar_t**){try{+ using namespace veyra;+ Gdiplus::GdiplusStartupInput graphicsInput;ULONG_PTR graphicsToken=0;+ Gdiplus::GdiplusStartup(&graphicsToken,&graphicsInput,nullptr);+ INITCOMMONCONTROLSEX controls{sizeof(controls),ICC_WIN95_CLASSES};InitCommonControlsEx(&controls);+ engine::EngineController engine;+ engine::EnhancementSettings actual,defaults;+ bool reject=false;+ HWND parent=CreateWindowExW(0,L"STATIC",L"Veyra slider reset verification",WS_OVERLAPPEDWINDOW|WS_VISIBLE|WS_CLIPCHILDREN,100,100,390,850,nullptr,nullptr,GetModuleHandleW(nullptr),nullptr);+ auto panel=ui::createSettingsPanel(parent,engine,[&](auto settings){+ if(reject)return false;+ actual=settings;ui::settingsEnabled(false,actual);return true;+ });+ SetWindowPos(panel,nullptr,0,0,360,800,SWP_NOZORDER|SWP_SHOWWINDOW);+ auto sync=[&](){ui::settingsEnabled(false,actual);SendMessageW(panel,WM_TIMER,1,0);};+ auto verify=[&](int id,auto change,auto restore){+ actual=defaults;actual.color.enabled=true;actual.color.contrast=17;actual.videoHdr.enabled=true;+ change(actual);++actual.revision;sync();+ auto expected=actual;restore(expected);+ auto button=ui::settingsControlForTest(id);+ require(button&&IsWindowEnabled(button),"changed row must enable reset");+ SendMessageW(button,BM_CLICK,0,0);+ require(actual==expected,"reset must change only its own parameter and retain effect switches");+ require(!IsWindowEnabled(button),"default row must disable reset");+ };+ verify(2600,[](auto& s){s.model.intensity=.37f;},[&](auto& s){s.model.intensity=defaults.model.intensity;});+ verify(2622,[](auto& s){s.protection.featherPixels=33;},[&](auto& s){s.protection.featherPixels=defaults.protection.featherPixels;});+ verify(2634,[](auto& s){s.videoHdr.peakNits=1400;},[&](auto& s){s.videoHdr.peakNits=defaults.videoHdr.peakNits;});+ verify(3400,[](auto& s){s.color.exposure=1.5f;},[&](auto& s){s.color.exposure=defaults.color.exposure;});+ auto undo=ui::settingsControlForTest(802);SendMessageW(undo,BM_CLICK,0,0);+ require(actual.color.exposure==1.5f&&actual.color.contrast==17,"colour reset must support undo");+ const int blendReset=ui::colourParamEditId(L"混合")+2100;+ verify(blendReset,[](auto& s){s.color.gradingBlending=77;},[&](auto& s){s.color.gradingBlending=defaults.color.gradingBlending;});+ verify(ui::colourParamEditId(L"LUT 强度")+2100,[](auto& s){s.color.lutStrength=35;},[&](auto& s){s.color.lutStrength=defaults.color.lutStrength;});+ actual.color.exposure=2;++actual.revision;sync();auto before=actual;reject=true;+ SendMessageW(ui::settingsControlForTest(3400),BM_CLICK,0,0);+ require(actual==before&&IsWindowEnabled(ui::settingsControlForTest(3400)),"rejected transaction must retain the changed value");reject=false;+ ui::settingsPage(2);ui::settingsColorSectionForTest(0,true);+ for(int width:{280,328,420}){+ SetWindowPos(panel,nullptr,0,0,width,800,SWP_NOZORDER);+ RECT label{},value{},reset{};+ GetWindowRect(ui::settingsControlForTest(1200),&label);GetWindowRect(ui::settingsControlForTest(1300),&value);GetWindowRect(ui::settingsControlForTest(3400),&reset);+ require(label.right<=value.left&&value.right<reset.left&&reset.right-reset.left>=28,"row controls must remain separate at narrow widths");+ }+ ui::settingsColorSectionForTest(0,false);+ require(!(GetWindowLongW(ui::settingsControlForTest(3400),GWL_STYLE)&WS_VISIBLE),"collapsed row must hide reset");+ ui::settingsColorSectionForTest(0,true);+ SetWindowPos(panel,nullptr,0,0,360,800,SWP_NOZORDER);+ std::cout<<"PASS: individual defaults, unrelated settings, undo, rejection, enabled state, narrow layout and folding\n";+ if(argc>1){const auto end=GetTickCount64()+60000;MSG msg{};while(GetTickCount64()<end&&IsWindow(parent)){while(PeekMessageW(&msg,nullptr,0,0,PM_REMOVE)){TranslateMessage(&msg);DispatchMessageW(&msg);}Sleep(10);}}+ DestroyWindow(parent);return 0;+}catch(const std::exception& e){std::cerr<<e.what()<<'\n';return 1;}}