Skip to content

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-mig): G1.5 M14/M15 VMenu popover replaces Qt Menu, preset library load fix, video region cutout for covers

Veyra Goal Agentefbd386fa79c
diff --git a/apps/veyra-qml/main.cpp b/apps/veyra-qml/main.cpp
index 4aca7205..d34c7d98 100644
--- a/apps/veyra-qml/main.cpp
+++ b/apps/veyra-qml/main.cpp
@@ -17,11 +17,14 @@
#include <QQuickWindow>
#include <QTimer>
#include <QVariantMap>
+#include <QList>
+#include <QRect>
#include <QtCore/private/qabstractanimation_p.h>
#include <QDebug>
#include <windows.h>
+#include <cmath>
#include <format>
#include <memory>
@@ -81,6 +84,58 @@ void syncVideoGeometry(QQuickWindow* window, QQuickItem* host) {
const int h = std::max(1, int(std::floor(host->height() * dpr)));
SetWindowPos(g_video, HWND_TOP, x, y, w, h, SWP_NOACTIVATE | SWP_SHOWWINDOW);
}
+
+struct Cover { QRectF rect; qreal radius = 0; };
+
+void collectCovers(QQuickItem* item, QList<Cover>& out) {
+ if (!item->isVisible() || item->opacity() <= 0.0) return;
+ if (item->objectName() == QLatin1String("videoCover")) {
+ // Scale is folded into the scene rect; the corner radius scales with it.
+ const QRectF r = item->mapRectToScene(QRectF(0, 0, item->width(), item->height()));
+ const qreal s = item->width() > 0 ? r.width() / item->width() : 1.0;
+ out << Cover{r, item->property("coverRadius").toReal() * s};
+ }
+ for (QQuickItem* child : item->childItems()) collectCovers(child, out);
+}
+
+// The video is a native child window, so it is drawn above the whole QML scene
+// (airspace): a menu or a dialog over the picture would sit behind it. Items named
+// "videoCover" (popover panels, the dialog scrim) are cut out of the window's
+// region instead, so the QML under them shows. Scene rects include transforms,
+// so the hole follows a popover's scale-in. The region only changes when a cover
+// moves; with none the window gets its full rectangle back.
+void syncVideoCovers(QQuickWindow* window, QQuickItem* host) {
+ if (!window || !host || !g_video) return;
+ QList<Cover> covers;
+ collectCovers(window->contentItem()->parentItem() ? window->contentItem()->parentItem()
+ : window->contentItem(), covers);
+ const qreal dpr = window->devicePixelRatio();
+ const QPointF origin = host->mapToScene(QPointF(0, 0));
+ static QList<QRect> last;
+ QList<QRect> holes; // x, y, w, h; the radius rides along as a fifth rect
+ for (const Cover& c : covers) {
+ const QRectF local = c.rect.translated(-origin);
+ holes << QRect(int(std::floor(local.left() * dpr)), int(std::floor(local.top() * dpr)),
+ int(std::ceil(local.width() * dpr)) + 1, int(std::ceil(local.height() * dpr)) + 1);
+ holes << QRect(0, 0, int(std::round(c.radius * dpr * 2)), 0);
+ }
+ if (holes == last) return;
+ last = holes;
+ if (holes.isEmpty()) { SetWindowRgn(g_video, nullptr, TRUE); return; }
+ const int w = std::max(1, int(std::floor(host->width() * dpr)));
+ const int h = std::max(1, int(std::floor(host->height() * dpr)));
+ HRGN region = CreateRectRgn(0, 0, w, h);
+ for (qsizetype i = 0; i + 1 < holes.size(); i += 2) {
+ const QRect& hole = holes[i];
+ const int d = holes[i + 1].width();
+ HRGN cut = d > 0 ? CreateRoundRectRgn(hole.left(), hole.top(), hole.left() + hole.width() + 1,
+ hole.top() + hole.height() + 1, d, d)
+ : CreateRectRgn(hole.left(), hole.top(), hole.left() + hole.width(), hole.top() + hole.height());
+ CombineRgn(region, region, cut, RGN_DIFF);
+ DeleteObject(cut);
+ }
+ SetWindowRgn(g_video, region, TRUE); // the system owns the region from here
+}
} // namespace
int main(int argc, char** argv) {
@@ -141,11 +196,12 @@ int main(int argc, char** argv) {
// --tab <quality|fg|color|audio|display> professional-page tab
// --dialog <capture|ps5|screen|subtitle|audio|save|manage|tonode>
// --aspect <ratio> cinema aspect, overriding the source's own
+ // --menu <source|preset> professional-page popover menu open
// --dock-pinned dock open and held open
// --size <W>x<H> window size in device-independent pixels
// --reduced-motion every animation at zero duration
// --slow-animations <N> every animation N times slower (motion sampling)
- // --motion-probe <name> dock | page | switch: start that motion, log its value per frame
+ // --motion-probe <name> dock | page | switch | seg | menu: start that motion, log its value per frame
const QStringList args = QCoreApplication::arguments();
QString openPath;
QVariantMap testOptions;
@@ -159,6 +215,8 @@ int main(int argc, char** argv) {
testOptions.insert(QStringLiteral("tab"), args.at(++i));
} else if (a == QLatin1String("--dialog") && hasValue) {
testOptions.insert(QStringLiteral("dialog"), args.at(++i));
+ } else if (a == QLatin1String("--menu") && hasValue) {
+ testOptions.insert(QStringLiteral("menu"), args.at(++i));
} else if (a == QLatin1String("--aspect") && hasValue) {
testOptions.insert(QStringLiteral("aspect"), args.at(++i).toDouble());
} else if (a == QLatin1String("--dock-pinned")) {
@@ -243,6 +301,7 @@ int main(int argc, char** argv) {
w, h, int(host->x()), int(host->y())));
}
syncVideoGeometry(window, host);
+ syncVideoCovers(window, host);
}
});
follow->start(16);
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index b9650305..dfe3e05b 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -6602,3 +6602,16 @@ release. 5090 live acceptance, 15-second hitch and user flicker remain unresolve
最小复现 `tmp/.../min/Icons.qml`(qml.exe)对比 headless Edge 渲染 icons.html:初次 layers/x/search/box/image 错位——多元素拼成一条 path 时首个相对 m 接在上一元素终点,改为前置 M0 0 后 65 个全部一致(icons-cmp.png)。
验证:sync、`shoot-all.ps1 -Frames f-home,f-min,f-pro,f-node,f-cap,f-aud,f-sub,f-color` + `compose-compare.ps1`,看图:dock/来源卡/手风琴/相机/播放/快进快退图标正确;f-min 黑屏、f-aud 对话框被视频窗遮挡与 qml-ref 基线相同,属既有差距(G3)。
偏差:设计无锁图标,锁定节点用 key。NOTICES Lucide 条目补充本次来源。
+
+- G1.5 组件动效(进行中,证据 `E:/项目/Veyra/logs/ui-qml-migration-20260925/goal/g1.5-*`):
+ - M12 分段指示条随 spring 滑动(4a1fe2e),`motion.ps1 -Probes seg` 曲线与设计一致。
+ - M14/M15 弹层:新 `VMenu.qml`(设计 .pop/.opt:opacity .15s,scale .9→1、下移 8px→0 用 .45s spring,原点取锚点中心;勾选 opacity .15s + scale .4→1 .4s spring;点击 130 ms 后关闭再回调)。取代 Qt Menu:VSelect、专业页片源/列表预设、极简页预设胶囊、节点页双击添加节点。
+ - Qt Popup 不是 Item,没有 transform,变换放在 contentItem 上(第一次写在 Popup 上时整个应用加载失败)。
+ - 后端修正:`PlayerUiFacade::importLegacyStores` 从未调用 `PresetLibrary::load()`,导致 presets() 为空。修正后显示 4 个内置预设,顶栏为"预设:原画"。
+ - 空域:原生视频子窗压在 QML 上面。main.cpp `syncVideoCovers` 把 objectName=videoCover 的可见项按 coverRadius 从视频窗 `SetWindowRgn` 挖掉(圆角区域);zoom-src.png 圆角正确。
+ - 探针:shotpage.js 增加 menu 分支。
+ - 设计页有 18 个 .pop,须在 root 内查询,否则读到别的页。
+ - rAF 在虚拟时间不跑,探针自己加 .open。
+ - 结果:设计峰值 1.0042,QML 峰值 1.0042,chart-menu.png 曲线重合(QML 约晚一采样帧)。
+ - 回归:`shoot.ps1 -Step g1.5-menu -Frames f-pro,x-menu-src,x-menu-preset` 看图正常;f-pro 的既有差距(质量 seg 无选中、未开片源)属 G3。
+ - shoot-all 增加 x-menu-src/x-menu-preset 审查态;motion-sample 增加 menu。
diff --git a/include/veyra/ui/PlayerUiFacade.h b/include/veyra/ui/PlayerUiFacade.h
index 74f1fb8c..bf870496 100644
--- a/include/veyra/ui/PlayerUiFacade.h
+++ b/include/veyra/ui/PlayerUiFacade.h
@@ -55,8 +55,9 @@ public:
// Saves the settings the UI is currently showing (pending, not applied -
// the user saves what they see).
bool savePreset(const veyra::engine::PresetEntry& entry, bool replace);
- // Migrates the older single-purpose stores the first time the library is
- // empty, so nobody loses their presets. Never overwrites an existing name.
+ // Loads the preset library (once), then migrates the older single-purpose
+ // stores into it, so nobody loses their presets. Never overwrites an
+ // existing name.
bool importLegacyStores();
// --- recent files ------------------------------------------------------
@@ -108,6 +109,7 @@ public:
private:
veyra::engine::EngineController& engine_;
veyra::engine::PresetLibrary presets_;
+ bool presetsLoaded_ = false;
std::filesystem::path dataDirectory_;
veyra::engine::PlayerSnapshot last_{};
veyra::engine::EnhancementSettings pending_{};
diff --git a/prototypes/ui-redesign-2026-09-25/shotpage.js b/prototypes/ui-redesign-2026-09-25/shotpage.js
index cd5adb5f..28703417 100644
--- a/prototypes/ui-redesign-2026-09-25/shotpage.js
+++ b/prototypes/ui-redesign-2026-09-25/shotpage.js
@@ -101,10 +101,22 @@
const x0 = tx(), x1 = btns[btns.length - 1].offsetLeft;
start = () => btns[btns.length - 1].click();
read = () => ((tx() - x0) / (x1 - x0)).toFixed(4);
+ } else if (probe === 'menu') {
+ // The professional page's source menu; the popover's scale .9 -> 1. app.menu adds
+ // .open on the next animation frame, which headless virtual time does not run, so
+ // the probe does that step itself after the closed style has been computed.
+ const pop = root.querySelector('.pop');
+ start = () => {
+ [...root.querySelectorAll('[data-srcbtn]')].find(x => x.offsetParent !== null).click();
+ getComputedStyle(pop).scale; pop.classList.add('open'); getComputedStyle(pop).scale;
+ };
+ read = () => (+getComputedStyle(pop).scale).toFixed(4);
} else return;
start();
+ if (probe === 'menu') { sample(); return; } // the transitions exist now; waiting lets them finish
// The page switch shows the new page 150 ms later; wait for its animations to exist.
- setTimeout(function () {
+ setTimeout(sample, probe === 'page' ? 200 : 30);
+ function sample() {
const anims = () => document.getAnimations();
anims().forEach(a => a.pause());
if (freezeAt !== null) { anims().forEach(a => a.currentTime = +freezeAt); document.title = 'ready'; return; }
@@ -112,6 +124,6 @@
for (let t = 0; t <= 1000; t += 10) { anims().forEach(a => a.currentTime = t); rows.push(t + ',' + read()); }
const pre = document.createElement('pre'); pre.id = 'motion-csv'; pre.textContent = rows.join(String.fromCharCode(10));
document.body.appendChild(pre); document.title = 'ready';
- }, probe === 'page' ? 200 : 30);
+ }
}
})();
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 2f87cc35..184819e0 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -265,6 +265,7 @@ Window {
if (name === "dock") dock.opened = true
else if (name === "page") root.page = "pro"
else if (name === "switch") probeSwitch.item.checked = true
+ else if (name === "menu") proPage.openTestMenu("source")
else if (name === "seg") { probe.x0 = probeSeg.item.indicatorX; probeSeg.item.current = "c"; probe.x1 = probeSeg.item.targetX }
probe.t0 = Date.now()
probe.running = true
@@ -282,6 +283,7 @@ Window {
let v
if (name === "dock") v = dock.barY
else if (name === "page") v = proPage.opacity + "," + proPage.y
+ else if (name === "menu") v = proPage.testMenuScale.toFixed(4)
else if (name === "seg") v = ((probeSeg.item.indicatorX - x0) / (x1 - x0)).toFixed(4)
else if (probeSwitch.item) v = probeSwitch.item.children[0].x - 3
else return
@@ -298,5 +300,8 @@ Window {
if (root.testAspect > 0) root.fitToFilm(root.testAspect)
if (root.test.dialog !== undefined) dialogs.open(root.test.dialog)
videoHost.syncRect()
+ if (root.test.menu !== undefined) testMenuTimer.start()
}
+ // The menu anchors on laid-out buttons, so it opens once the page has settled.
+ Timer { id: testMenuTimer; interval: 600; onTriggered: proPage.openTestMenu(root.test.menu) }
}
diff --git a/qml/Veyra/MinimalPage.qml b/qml/Veyra/MinimalPage.qml
index 250c4a68..db50482e 100644
--- a/qml/Veyra/MinimalPage.qml
+++ b/qml/Veyra/MinimalPage.qml
@@ -231,7 +231,7 @@ Item {
VPill {
key: ""
value: veyra.currentPresetName
- onClicked: presetMenu.popup()
+ onClicked: presetMenu.openAt(this, "up")
Rectangle {
width: 7; height: 7; radius: 3.5
color: veyra.failed ? Theme.err : veyra.captureRecovering ? Theme.warn : Theme.ok
@@ -268,17 +268,18 @@ Item {
}
// The preset menu: list presets and node presets in one menu, as designed.
- Menu {
+ // pages-a.js presetMenu: list presets, node presets, then the way to manage them.
+ VMenu {
id: presetMenu
- width: 260
- Repeater {
- model: veyra.presets
- delegate: MenuItem {
- required property var modelData
- text: modelData.name + (modelData.builtin ? " (内置)" : "")
- + (modelData.nodeMode ? " · 节点" : "")
- onTriggered: veyra.applyPresetIndex(modelData.index)
- }
+ title: "预设"
+ readonly property var mk: p => ({ label: p.name, note: p.note, checked: p.name === veyra.currentPresetName,
+ tag: p.nodeMode ? "节点" : "", preset: p.index })
+ items: [{ head: "列表预设" }].concat(veyra.presets.filter(p => !p.nodeMode).map(mk))
+ .concat([{ head: "节点预设" }]).concat(veyra.presets.filter(p => p.nodeMode).map(mk))
+ .concat([{ sep: true }, { label: "去专业模式管理预设…", icon: "sliders", act: "pro" }])
+ onPicked: (i, o) => {
+ if (o.act === "pro") root.requestPage("pro")
+ else veyra.applyPresetIndex(o.preset)
}
}
diff --git a/qml/Veyra/NodePage.qml b/qml/Veyra/NodePage.qml
index b7960565..b22a8240 100644
--- a/qml/Veyra/NodePage.qml
+++ b/qml/Veyra/NodePage.qml
@@ -229,9 +229,15 @@ Item {
root.zoom = Math.max(0.4, Math.min(2.0, root.zoom * (event.angleDelta.y > 0 ? 1.1 : 0.9)))
}
}
+ // The add menu opens under the double-clicked point.
+ Item { id: tapAnchor; width: 1; height: 1 }
TapHandler {
acceptedButtons: Qt.LeftButton
- onDoubleTapped: addMenu.popup()
+ onDoubleTapped: eventPoint => {
+ tapAnchor.x = eventPoint.position.x
+ tapAnchor.y = eventPoint.position.y
+ addMenu.openAt(tapAnchor, "down")
+ }
}
// .timing strip: each stage coloured by its cost; the remainder is
@@ -405,15 +411,10 @@ Item {
}
}
- Menu {
+ VMenu {
id: addMenu
- Repeater {
- model: veyra.effectCatalog
- delegate: MenuItem {
- required property var modelData
- text: modelData.label
- onTriggered: veyra.addEffect(modelData.id)
- }
- }
+ title: "添加节点"
+ items: veyra.effectCatalog.map(e => ({ label: e.label, id: e.id, tag: e.experimental ? "实验" : "", tagKind: e.experimental ? "warn" : "" }))
+ onPicked: (i, o) => veyra.addEffect(o.id)
}
}
diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qml
index 5ed6401a..b1796e9d 100644
--- a/qml/Veyra/ProPage.qml
+++ b/qml/Veyra/ProPage.qml
@@ -33,9 +33,10 @@ Item {
spacing: 8
VButton {
+ id: sourceBtn
iconName: "video"
text: veyra.isCapture ? "采集卡" : "片源"
- onClicked: sourceMenu.popup()
+ onClicked: sourceMenu.openAt(this, "down")
}
VTag { text: veyra.sourceSummary.length > 0 ? veyra.sourceSummary : "未打开" }
Item { Layout.fillWidth: true }
@@ -49,8 +50,9 @@ Item {
}
VButton { iconName: "camera"; text: "截图"; onClicked: veyra.takeScreenshot() }
VButton {
+ id: presetBtn
text: "预设:" + veyra.currentPresetName
- onClicked: presetMenu.popup()
+ onClicked: presetMenu.openAt(this, "down")
}
}
@@ -901,29 +903,47 @@ Item {
}
}
- Menu {
+ // Test hook (--menu, motion probe "menu"): open a header menu from its button.
+ function openTestMenu(name) {
+ if (name === "source") sourceMenu.openAt(sourceBtn, "down")
+ else if (name === "preset") presetMenu.openAt(presetBtn, "down")
+ }
+ readonly property real testMenuScale: sourceMenu.motionScale
+
+ // pages-pro.js data-srcbtn: the open source first (checked), then the ways in.
+ VMenu {
id: sourceMenu
- width: 260
- MenuItem { text: "打开文件…"; onTriggered: veyra.openFileDialog() }
- MenuItem { text: "采集卡设置…"; onTriggered: veyra.openCaptureDialog() }
- MenuItem { text: "PS5 串流…"; onTriggered: veyra.openPs5Dialog() }
- MenuItem { text: "屏幕捕获…"; onTriggered: veyra.openScreenCaptureDialog() }
+ title: "片源"
+ items: (veyra.sourceName.length > 0
+ ? [{ label: (veyra.isCapture ? "采集卡 · " : "") + veyra.sourceName, note: veyra.sourceSummary,
+ checked: true, icon: "video", act: "" }] : [])
+ .concat([{ label: "打开文件…", icon: "folder", act: "file" },
+ { label: "PS5 串流…", icon: "gamepad", act: "ps5" },
+ { label: "屏幕捕获…", icon: "monitor", act: "screen" },
+ { sep: true },
+ { label: "采集卡设置…", icon: "settings", act: "capture" }])
+ onPicked: (i, o) => {
+ if (o.act === "file") veyra.openFileDialog()
+ else if (o.act === "ps5") veyra.openPs5Dialog()
+ else if (o.act === "screen") veyra.openScreenCaptureDialog()
+ else if (o.act === "capture") veyra.openCaptureDialog()
+ }
}
// The design puts 另存为 / 管理 in the professional page's preset menu.
- Menu {
+ // presets.js VY.presetMenu(app, anchor, 'list').
+ VMenu {
id: presetMenu
- width: 260
- Repeater {
- model: veyra.presets
- delegate: MenuItem {
- required property var modelData
- text: modelData.name + (modelData.builtin ? " (内置)" : "")
- onTriggered: veyra.applyPresetIndex(modelData.index)
- }
+ title: "列表预设"
+ items: veyra.presets.filter(p => !p.nodeMode)
+ .map(p => ({ label: p.name, note: p.note, checked: p.name === veyra.currentPresetName,
+ tag: p.builtin ? "内置" : "", preset: p.index }))
+ .concat([{ sep: true },
+ { label: "把当前设置另存为预设…", icon: "plus", act: "save" },
+ { label: "管理预设…", note: "重命名 · 删除 · 设为启动默认", icon: "settings", act: "manage" }])
+ onPicked: (i, o) => {
+ if (o.act) root.requestDialog(o.act)
+ else veyra.applyPresetIndex(o.preset)
}
- MenuSeparator { }
- MenuItem { text: "另存为预设…"; onTriggered: root.requestDialog("save") }
- MenuItem { text: "管理预设…"; onTriggered: root.requestDialog("manage") }
}
// Switching to node mode rebuilds the chain, so the design asks first.
diff --git a/qml/Veyra/VMenu.qml b/qml/Veyra/VMenu.qml
new file mode 100644
index 00000000..50c3bba6
--- /dev/null
+++ b/qml/Veyra/VMenu.qml
@@ -0,0 +1,237 @@
+// .pop / .opt — the design's popover menu (core.js app.menu, app.css .pop).
+//
+// Items: [{ label, note, icon, checked, disabled, tag, sep, head }] like the design's
+// list; `picked(index, item)` fires 130 ms after the click, once the check has moved,
+// and the menu closes (core.js: setTimeout(() => { closeMenu(); onPick(o) }, 130)).
+// Opening (M14): opacity .15s, scale .9 -> 1 and translate 0 8px -> 0 over .45s
+// --spring, from the anchor's centre on the edge nearest the anchor.
+// The check (M15): opacity .15s, scale .4 -> 1 over .4s --spring.
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Effects
+
+Popup {
+ id: pop
+ property string title: ""
+ property var items: []
+ property Item anchorItem: null
+ property bool above: false
+ signal picked(int index, var item)
+
+ // The design's local copy of the checked flags, so the tick moves on click
+ // before the owner's model catches up.
+ property var checks: []
+ onItemsChanged: checks = items.map(o => o.checked === true)
+
+ // place: "up" (the design's default) or "down" (selects).
+ function openAt(anchor, place) {
+ anchorItem = anchor
+ checks = items.map(o => o.checked === true)
+ const win = anchor.Window.contentItem
+ const r = anchor.mapToItem(win, 0, 0)
+ const w = Math.max(220, anchor.width)
+ width = w
+ const ph = implicitHeight
+ x = 0; y = 0
+ const pw = w
+ let px = Math.max(8, Math.min(r.x + anchor.width / 2 - pw / 2, win.width - pw - 8))
+ let py = place === "down" ? r.y + anchor.height + 8 : r.y - ph - 8
+ if (py < 8) py = r.y + anchor.height + 8
+ if (py + ph > win.height - 8) py = Math.max(8, r.y - ph - 8)
+ above = py < r.y
+ originX = r.x + anchor.width / 2 - px
+ const p = parent.mapFromItem(win, px, py)
+ x = p.x; y = p.y
+ open()
+ }
+ property real originX: width / 2
+ // For the motion probe.
+ readonly property real motionScale: motion.s
+
+ parent: Overlay.overlay
+ padding: 0
+ modal: false
+ closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
+ implicitHeight: Math.min(420, col.implicitHeight + 12)
+ background: null
+
+ enter: Transition {
+ ParallelAnimation {
+ NumberAnimation { property: "opacity"; from: 0; to: 1; duration: Theme.d(150) }
+ NumberAnimation { target: motion; property: "s"; from: 0.9; to: 1; duration: Theme.d(450); easing.bezierCurve: Theme.spring }
+ NumberAnimation { target: motion; property: "dy"; from: 8; to: 0; duration: Theme.d(450); easing.bezierCurve: Theme.spring }
+ }
+ }
+ exit: Transition {
+ ParallelAnimation {
+ NumberAnimation { property: "opacity"; to: 0; duration: Theme.d(150) }
+ NumberAnimation { target: motion; property: "s"; to: 0.9; duration: Theme.d(450); easing.bezierCurve: Theme.spring }
+ NumberAnimation { target: motion; property: "dy"; to: 8; duration: Theme.d(450); easing.bezierCurve: Theme.spring }
+ }
+ }
+ QtObject { id: motion; property real s: 1; property real dy: 0 }
+
+ // Popup itself is not an Item, so one content item carries the shadow, the panel
+ // and the list, and the scale/translate motion with them.
+ contentItem: Item {
+ // Cut out of the native video window (main.cpp syncVideoCovers).
+ objectName: "videoCover"
+ property real coverRadius: 14
+ transform: [
+ Scale {
+ origin.x: pop.originX
+ origin.y: pop.above ? pop.height : 0
+ xScale: motion.s
+ yScale: motion.s
+ },
+ Translate { y: motion.dy }
+ ]
+ // box-shadow: 0 24px 50px -12px rgba(0,0,0,.8): the -12px spread insets the
+ // shadow's shape, the offset and blur come from the effect.
+ Rectangle {
+ id: shadowSrc
+ anchors.fill: parent
+ anchors.margins: 12
+ radius: 14
+ color: "black"
+ visible: false
+ }
+ MultiEffect {
+ source: shadowSrc
+ anchors.fill: shadowSrc
+ shadowEnabled: true
+ shadowColor: Qt.rgba(0, 0, 0, 0.8)
+ shadowBlur: 1.0
+ blurMax: 50
+ shadowVerticalOffset: 24
+ autoPaddingEnabled: true
+ }
+ Rectangle {
+ anchors.fill: parent
+ radius: 14
+ color: Theme.popover
+ border.width: 1
+ border.color: Theme.stroke2
+ }
+ Flickable {
+ anchors.fill: parent
+ anchors.margins: 6
+ clip: true
+ contentHeight: col.implicitHeight
+ implicitHeight: col.implicitHeight
+ boundsBehavior: Flickable.StopAtBounds
+ ColumnLayout {
+ id: col
+ width: parent.width
+ spacing: 0
+ // .pop h6
+ Text {
+ visible: pop.title.length > 0
+ Layout.margins: 6
+ Layout.leftMargin: 10
+ text: pop.title
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ font.weight: Font.Medium
+ font.letterSpacing: 0.44
+ }
+ Repeater {
+ model: pop.items
+ delegate: Loader {
+ id: row
+ required property var modelData
+ required property int index
+ Layout.fillWidth: true
+ sourceComponent: modelData.sep ? sepC : modelData.head ? headC : optC
+ Component {
+ id: sepC
+ Item {
+ implicitHeight: 9
+ Rectangle { x: 6; width: parent.width - 12; y: 4; height: 1; color: Theme.stroke }
+ }
+ }
+ Component {
+ id: headC
+ Text {
+ topPadding: 6; bottomPadding: 6; leftPadding: 10
+ text: row.modelData.head
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ font.weight: Font.Medium
+ }
+ }
+ Component {
+ id: optC
+ // .opt: padding 8px 10px, radius 9, hover rgba(255,255,255,.06).
+ Rectangle {
+ implicitHeight: optRow.implicitHeight + 16
+ radius: 9
+ opacity: row.modelData.disabled ? 0.4 : 1
+ color: optHover.hovered && !row.modelData.disabled ? Qt.rgba(1, 1, 1, 0.06) : "transparent"
+ RowLayout {
+ id: optRow
+ anchors.left: parent.left; anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.leftMargin: 10; anchors.rightMargin: 10
+ spacing: 10
+ VIcon { visible: !!row.modelData.icon; name: row.modelData.icon || ""; color: Theme.t1 }
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 3
+ Text {
+ Layout.fillWidth: true
+ text: row.modelData.label
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ font.weight: Font.Medium
+ elide: Text.ElideRight
+ }
+ Text {
+ visible: !!row.modelData.note
+ Layout.fillWidth: true
+ text: row.modelData.note || ""
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ wrapMode: Text.WordWrap
+ }
+ }
+ VTag { visible: !!row.modelData.tag; text: row.modelData.tag || ""; kind: row.modelData.tagKind || "" }
+ // .chk: margin-left auto, accent, .4 -> 1 on the spring.
+ VIcon {
+ name: "check"
+ color: Theme.accent
+ readonly property bool on: pop.checks[row.index] === true
+ opacity: on ? 1 : 0
+ scale: on ? 1 : 0.4
+ Behavior on opacity { NumberAnimation { duration: Theme.d(150) } }
+ Behavior on scale { NumberAnimation { duration: Theme.d(400); easing.bezierCurve: Theme.spring } }
+ }
+ }
+ HoverHandler { id: optHover; enabled: !row.modelData.disabled; cursorShape: Qt.PointingHandCursor }
+ TapHandler {
+ enabled: !row.modelData.disabled
+ onTapped: {
+ pop.checks = pop.items.map((o, i) => i === row.index)
+ pickTimer.index = row.index
+ pickTimer.restart()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ Timer {
+ id: pickTimer
+ property int index: -1
+ interval: 130
+ onTriggered: { pop.close(); pop.picked(index, pop.items[index]) }
+ }
+}
diff --git a/qml/Veyra/VSelect.qml b/qml/Veyra/VSelect.qml
index 9ad43b31..2e3a2fed 100644
--- a/qml/Veyra/VSelect.qml
+++ b/qml/Veyra/VSelect.qml
@@ -5,6 +5,8 @@ Rectangle {
id: sel
property string value: ""
property var options: [] // [{ id, label }]
+ // .pop h6: the design titles a select's menu with the row label (core.js sel()).
+ property string title: ""
signal picked(string id)
implicitWidth: 150
@@ -14,7 +16,7 @@ Rectangle {
border.width: 1
border.color: Theme.stroke
HoverHandler { id: hover; cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: menu.popup() }
+ TapHandler { onTapped: menu.openAt(sel, "down") }
RowLayout {
anchors.fill: parent
@@ -32,16 +34,16 @@ Rectangle {
VIcon { name: "down"; size: 14; color: Theme.t3 }
}
- Menu {
+ VMenu {
id: menu
- width: Math.max(sel.width, 180)
- Repeater {
- model: sel.options
- delegate: MenuItem {
- required property var modelData
- text: modelData.label
- onTriggered: sel.picked(modelData.id)
- }
+ // Default to the enclosing VRow's label, as the design's sel(label, ...) does.
+ title: {
+ if (sel.title.length > 0) return sel.title
+ for (let p = sel.parent; p; p = p.parent)
+ if (p instanceof VRow) return p.label
+ return ""
}
+ items: sel.options.map(o => ({ label: o.label, checked: o.label === sel.value }))
+ onPicked: (i, o) => sel.picked(sel.options[i].id)
}
}
diff --git a/qml/Veyra/qmldir b/qml/Veyra/qmldir
index db3c8a9f..a5d7d142 100644
--- a/qml/Veyra/qmldir
+++ b/qml/Veyra/qmldir
@@ -21,3 +21,4 @@ VSlider 1.0 VSlider.qml
VSwitch 1.0 VSwitch.qml
VTag 1.0 VTag.qml
Main 1.0 Main.qml
+VMenu 1.0 VMenu.qml
diff --git a/src/ui/PlayerUiFacade.cpp b/src/ui/PlayerUiFacade.cpp
index 8f9e242f..e52721d8 100644
--- a/src/ui/PlayerUiFacade.cpp
+++ b/src/ui/PlayerUiFacade.cpp
@@ -96,6 +96,13 @@ bool PlayerUiFacade::savePreset(const veyra::engine::PresetEntry& entry, bool re
}
bool PlayerUiFacade::importLegacyStores() {
+ // The library has to be read first: importing into an unloaded library would
+ // save it as built-ins plus imports and overwrite the user's own presets.v1.
+ // A corrupt file stays loaded-as-corrupt, and the library then refuses to save.
+ if (!presetsLoaded_) {
+ presetsLoaded_ = true;
+ if (!presets_.load()) { error_ = presets_.error(); return false; }
+ }
// The old files are read-only inputs: they stay on disk untouched so a
// downgrade still finds them. Their positional schema is owned by
// PresetStore, so the migration goes through that parser instead of
diff --git a/tools/qt_probe/motion-sample.ps1 b/tools/qt_probe/motion-sample.ps1
index 0444484e..77d59ca5 100644
--- a/tools/qt_probe/motion-sample.ps1
+++ b/tools/qt_probe/motion-sample.ps1
@@ -17,7 +17,7 @@ $proto = Join-Path (Split-Path -Parent (Split-Path -Parent $PSScriptRoot)) 'prot
$profile = 'E:\项目\Veyra\tmp\ui-qml-migration-20260925\edge-profile'
$log = Join-Path $App 'logs\veyra-qml.log'
# Where each motion lives in the design: the switch sits on the capture dialog.
-$designFrame = @{ dock = 'f-home'; switch = 'f-cap'; page = 'f-home'; seg = 'f-cap' }
+$designFrame = @{ dock = 'f-home'; switch = 'f-cap'; page = 'f-home'; seg = 'f-cap'; menu = 'f-pro' }
function Read-Curve([string[]]$lines) {
# "t,value" or "t,opacity,y": the curve is the last column.
@@ -34,7 +34,7 @@ foreach ($name in $Probes) {
$design | Set-Content -Encoding utf8 (Join-Path $Out "design-$name.csv")
$before = if (Test-Path $log) { (Get-Content $log).Count } else { 0 }
- $p = Start-Process -FilePath (Join-Path $App 'veyra_qml_ui.exe') -ArgumentList @('--page', 'home', '--motion-probe', $name) -PassThru
+ $p = Start-Process -FilePath (Join-Path $App 'veyra_qml_ui.exe') -ArgumentList @('--page', $(if ($name -eq 'menu') { 'pro' } else { 'home' }), '--motion-probe', $name) -PassThru
Start-Sleep -Seconds 4
Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue
Start-Sleep -Milliseconds 500
diff --git a/tools/qt_probe/shoot-all.ps1 b/tools/qt_probe/shoot-all.ps1
index 73168fa6..f3f68640 100644
--- a/tools/qt_probe/shoot-all.ps1
+++ b/tools/qt_probe/shoot-all.ps1
@@ -32,6 +32,9 @@ $states = [ordered]@{
'f-node' = @('node', '--size 1600x1150')
'f-exp' = @('exp', '')
'f-set' = @('set', '')
+ # Not design frames: states the frames only show in passing (menus), shot for review.
+ 'x-menu-src' = @('pro', '--menu source')
+ 'x-menu-preset' = @('pro', '--menu preset')
}
$capture = Join-Path $PSScriptRoot 'capture-window.ps1'
foreach ($id in $states.Keys) {