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): rebuild the shell and pages against the design, and fix what it exposed

Veyra Goal Agent31aaed4095d5
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index b6f5e992..55bad627 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -39,6 +39,36 @@ namespace veyra::ui {
class QmlPlayerBridge : public QObject {
Q_OBJECT
+ // --- professional-page readouts ---------------------------------------
+ // Every one of these reports an engine value. Where the engine has no
+ // measurement the getter says so (e.g. displayFpsKnown stays false, because
+ // a display rate is only real if the system display event can be read - the
+ // design requires exactly this distinction rather than reusing submit FPS).
+ Q_PROPERTY(QString outputSummary READ outputSummary NOTIFY snapshotChanged)
+ Q_PROPERTY(double displayFps READ displayFps NOTIFY snapshotChanged)
+ Q_PROPERTY(bool displayFpsKnown READ displayFpsKnown NOTIFY snapshotChanged)
+ Q_PROPERTY(double queuedFrames READ queuedFrames NOTIFY snapshotChanged)
+ Q_PROPERTY(int skippedFrames READ skippedFrames NOTIFY snapshotChanged)
+ Q_PROPERTY(QString flowBackend READ flowBackend NOTIFY snapshotChanged)
+ Q_PROPERTY(QVariantList stageTimings READ stageTimings NOTIFY snapshotChanged)
+ Q_PROPERTY(double stageBudgetMs READ stageBudgetMs NOTIFY snapshotChanged)
+ // Total measured cost of the chain, or 0 when nothing has been measured.
+ Q_PROPERTY(double chainTotalMs READ chainTotalMs NOTIFY snapshotChanged)
+ Q_PROPERTY(double scheduleP95Ms READ scheduleP95Ms NOTIFY snapshotChanged)
+
+ // --- frame generation settings ----------------------------------------
+ Q_PROPERTY(QString fgBackendName READ fgBackendName WRITE setFgBackendName NOTIFY settingsChanged)
+ Q_PROPERTY(int fgMaxMultiplier READ fgMaxMultiplier NOTIFY snapshotChanged)
+ Q_PROPERTY(QVariantList fgMultiplierChoices READ fgMultiplierChoices NOTIFY snapshotChanged)
+ Q_PROPERTY(bool fgStrict READ fgStrict WRITE setFgStrict NOTIFY settingsChanged)
+ Q_PROPERTY(bool fgLowQueue READ fgLowQueue WRITE setFgLowQueue NOTIFY settingsChanged)
+
+ // --- colour settings ---------------------------------------------------
+ Q_PROPERTY(double colorExposure READ colorExposure WRITE setColorExposure NOTIFY settingsChanged)
+ Q_PROPERTY(double colorContrast READ colorContrast WRITE setColorContrast NOTIFY settingsChanged)
+ Q_PROPERTY(double colorSaturation READ colorSaturation WRITE setColorSaturation NOTIFY settingsChanged)
+ Q_PROPERTY(double colorTemperature READ colorTemperature WRITE setColorTemperature NOTIFY settingsChanged)
+
Q_PROPERTY(QString appName READ appName CONSTANT)
Q_PROPERTY(QString version READ version CONSTANT)
@@ -63,6 +93,9 @@ class QmlPlayerBridge : public QObject {
Q_PROPERTY(int sourceHeight READ sourceHeight NOTIFY snapshotChanged)
Q_PROPERTY(double sourceFps READ sourceFps NOTIFY snapshotChanged)
Q_PROPERTY(int sourceRotation READ sourceRotation NOTIFY snapshotChanged)
+ // The film's display aspect, so the window can snap to it in cinema mode
+ // exactly as the prototype's fitAspect() does. 0 when nothing is open.
+ Q_PROPERTY(double sourceAspect READ sourceAspect NOTIFY snapshotChanged)
// --- live performance --------------------------------------------------
// Submit FPS only. There is deliberately no "display FPS": the user asked
@@ -119,8 +152,15 @@ class QmlPlayerBridge : public QObject {
// --- dialogs the UI opens ----------------------------------------------
Q_PROPERTY(QVariantList recentFiles READ recentFiles NOTIFY recentFilesChanged)
Q_PROPERTY(QVariantList presets READ presets NOTIFY presetsChanged)
+ // The name of the preset currently in effect, or "自定义" when the
+ // settings no longer match any stored preset. Derived, never guessed.
+ Q_PROPERTY(QString currentPresetName READ currentPresetName NOTIFY settingsChanged)
Q_PROPERTY(QVariantList audioTracks READ audioTracks NOTIFY snapshotChanged)
Q_PROPERTY(int selectedAudioTrack READ selectedAudioTrack WRITE setSelectedAudioTrack NOTIFY snapshotChanged)
+ // The last capture session the user actually ran, for the home page's
+ // "continue" row. Absent until one exists: nothing is invented.
+ Q_PROPERTY(bool hasCaptureSession READ hasCaptureSession NOTIFY snapshotChanged)
+ Q_PROPERTY(QString captureSessionSummary READ captureSessionSummary NOTIFY snapshotChanged)
Q_PROPERTY(QString colorStatus READ colorStatus NOTIFY snapshotChanged)
Q_PROPERTY(QString videoHdrStatus READ videoHdrStatus NOTIFY snapshotChanged)
@@ -136,6 +176,35 @@ public:
QObject* parent = nullptr);
~QmlPlayerBridge() override;
+ QString outputSummary() const;
+ double displayFps() const;
+ bool displayFpsKnown() const;
+ double queuedFrames() const;
+ int skippedFrames() const;
+ QString flowBackend() const;
+ QVariantList stageTimings() const;
+ double stageBudgetMs() const;
+ double chainTotalMs() const;
+ double scheduleP95Ms() const;
+
+ QString fgBackendName() const;
+ void setFgBackendName(const QString& value);
+ int fgMaxMultiplier() const;
+ QVariantList fgMultiplierChoices() const;
+ bool fgStrict() const;
+ void setFgStrict(bool value);
+ bool fgLowQueue() const;
+ void setFgLowQueue(bool value);
+
+ double colorExposure() const;
+ void setColorExposure(double v);
+ double colorContrast() const;
+ void setColorContrast(double v);
+ double colorSaturation() const;
+ void setColorSaturation(double v);
+ double colorTemperature() const;
+ void setColorTemperature(double v);
+
QString appName() const;
QString version() const;
@@ -161,6 +230,7 @@ public:
int sourceHeight() const;
double sourceFps() const;
int sourceRotation() const;
+ double sourceAspect() const;
double submitFps() const;
bool submitFpsKnown() const;
@@ -226,9 +296,12 @@ public:
QVariantList recentFiles() const;
QVariantList presets() const;
+ QString currentPresetName() const;
QVariantList audioTracks() const;
int selectedAudioTrack() const;
void setSelectedAudioTrack(int index);
+ bool hasCaptureSession() const;
+ QString captureSessionSummary() const;
QString colorStatus() const;
QString videoHdrStatus() const;
@@ -254,6 +327,8 @@ public:
Q_INVOKABLE void openFileDialog();
Q_INVOKABLE void openPath(const QString& path);
Q_INVOKABLE void openCaptureDialog();
+ // Reopens the last capture session with the same device and format.
+ Q_INVOKABLE void resumeCaptureSession();
Q_INVOKABLE void openPs5Dialog();
Q_INVOKABLE void openScreenCaptureDialog();
Q_INVOKABLE void togglePlayPause();
@@ -266,6 +341,9 @@ public:
Q_INVOKABLE void startExport();
Q_INVOKABLE void cancelExport();
Q_INVOKABLE void quit();
+ // Returns this page's controls to the engine defaults (the design's
+ // "重置本页"); it does not touch presets or other pages.
+ Q_INVOKABLE void resetCurrentPage();
// Chain editing. The validator decides whether an edit is allowed where it
// was asked (frame generation is pinned last, RTX Video HDR immediately
diff --git a/prototypes/ui-redesign-2026-09-25/shot.html b/prototypes/ui-redesign-2026-09-25/shot.html
index 3da3f68b..a09961bd 100644
--- a/prototypes/ui-redesign-2026-09-25/shot.html
+++ b/prototypes/ui-redesign-2026-09-25/shot.html
@@ -50,3 +50,27 @@
<script src="presets.js"></script>
<script src="pages-b.js"></script>
<script src="board.js"></script>
+<div id="shotanchor"></div>
+<script>
+// Screenshot helper (build aid, untracked): focuses the design frame named in
+// ?f=<id> and hides the canvas chrome, so a capture is the app screen rather
+// than the whole board. index.html has no closing body tag, so this is appended
+// at the end of the document instead of replacing one.
+(function () {
+ const want = new URLSearchParams(location.search).get('f');
+ if (!want) return;
+ const hide = () => {
+ const tb = document.querySelector('.toolbar'); if (tb) tb.style.display = 'none';
+ const hint = document.querySelector('.hint'); if (hint) hint.style.display = 'none';
+ };
+ setTimeout(function () {
+ hide();
+ const btn = [...document.querySelectorAll('[data-f]')].find(b => b.dataset.f === want);
+ if (btn) btn.click();
+ setTimeout(function () {
+ document.querySelectorAll('.note, .frame-label, .frame-title').forEach(n => n.style.display = 'none');
+ hide();
+ }, 500);
+ }, 600);
+})();
+</script>
\ No newline at end of file
diff --git a/qml/Veyra/ChainList.qml b/qml/Veyra/ChainList.qml
index 13b436ab..8c8d10f8 100644
--- a/qml/Veyra/ChainList.qml
+++ b/qml/Veyra/ChainList.qml
@@ -39,6 +39,6 @@ ColumnLayout {
color: Theme.err
wrapMode: Text.WordWrap
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
}
}
diff --git a/qml/Veyra/ChainNodeCard.qml b/qml/Veyra/ChainNodeCard.qml
index decaa661..1dd1a365 100644
--- a/qml/Veyra/ChainNodeCard.qml
+++ b/qml/Veyra/ChainNodeCard.qml
@@ -18,12 +18,12 @@ Rectangle {
readonly property bool locked: node.mustBeLast === true
implicitHeight: 62
- radius: Theme.radiusCard
+ radius: Theme.rCard
color: selected ? Theme.card3 : Theme.card2
border.width: 1
border.color: selected ? Theme.accent : Theme.stroke
- Behavior on color { ColorAnimation { duration: Theme.durationFast } }
- Behavior on border.color { ColorAnimation { duration: Theme.durationFast } }
+ Behavior on color { ColorAnimation { duration: Theme.durFast } }
+ Behavior on border.color { ColorAnimation { duration: Theme.durFast } }
RowLayout {
anchors.fill: parent
@@ -37,13 +37,13 @@ Rectangle {
width: 34; height: 20; radius: 10
Layout.alignment: Qt.AlignVCenter
color: card.node.enabled ? Theme.accent : Theme.card3
- Behavior on color { ColorAnimation { duration: Theme.durationFast } }
+ Behavior on color { ColorAnimation { duration: Theme.durFast } }
Rectangle {
width: 14; height: 14; radius: 7
- color: card.node.enabled ? Theme.accentInk : Theme.text3
+ color: card.node.enabled ? Theme.accentInk : Theme.t3
anchors.verticalCenter: parent.verticalCenter
x: card.node.enabled ? parent.width - width - 3 : 3
- Behavior on x { NumberAnimation { duration: Theme.durationNormal; easing.bezierCurve: Theme.spring } }
+ Behavior on x { NumberAnimation { duration: Theme.durNormal; easing.bezierCurve: Theme.spring } }
}
HoverHandler { cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: card.toggleRequested(!card.node.enabled) }
@@ -54,14 +54,14 @@ Rectangle {
spacing: 1
Text {
text: card.node.label
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
}
Text {
text: card.locked ? "固定为最后一步" : (card.node.experimental ? "实验" : "")
visible: text.length > 0
- color: card.locked ? Theme.text3 : Theme.experimental
+ color: card.locked ? Theme.t3 : Theme.exp
font.family: Theme.fontUi
font.pixelSize: 10
}
@@ -79,7 +79,7 @@ Rectangle {
Text {
text: "✕"
visible: !card.locked
- color: removeHover.hovered ? Theme.err : Theme.text3
+ color: removeHover.hovered ? Theme.err : Theme.t3
font.pixelSize: 14
HoverHandler { id: removeHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: card.removeRequested() }
diff --git a/qml/Veyra/ExportPage.qml b/qml/Veyra/ExportPage.qml
index ad4b07be..6e5af4c3 100644
--- a/qml/Veyra/ExportPage.qml
+++ b/qml/Veyra/ExportPage.qml
@@ -23,9 +23,9 @@ Item {
Layout.fillWidth: true
Text {
text: "视频导出"
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeHeading
+ font.pixelSize: Theme.fsH1
Layout.fillWidth: true
}
Rectangle {
@@ -36,9 +36,9 @@ Item {
Text {
anchors.centerIn: parent
text: "返回"
- color: Theme.text2
+ color: Theme.t2
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
}
HoverHandler { id: backHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: root.requestPage("pro") }
@@ -47,7 +47,7 @@ Item {
Rectangle {
Layout.fillWidth: true
- radius: Theme.radiusCard
+ radius: Theme.rCard
color: Theme.card
implicitHeight: detail.implicitHeight + 32
@@ -65,25 +65,25 @@ Item {
columnSpacing: 12
rowSpacing: 10
- Text { text: "源"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
+ Text { text: "源"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: Theme.fsSmall }
Text {
Layout.fillWidth: true
text: veyra.hasSource ? veyra.sourceName + " " + veyra.sourceSummary : "未打开文件"
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
elide: Text.ElideMiddle
}
- Text { text: "输出"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
+ Text { text: "输出"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: Theme.fsSmall }
RowLayout {
Layout.fillWidth: true
Text {
Layout.fillWidth: true
text: veyra.exportTarget.length > 0 ? veyra.exportTarget : "未选择"
- color: veyra.exportTarget.length > 0 ? Theme.text1 : Theme.text3
+ color: veyra.exportTarget.length > 0 ? Theme.t1 : Theme.t3
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
elide: Text.ElideMiddle
}
Rectangle {
@@ -94,7 +94,7 @@ Item {
Text {
anchors.centerIn: parent
text: "选择…"
- color: Theme.text2
+ color: Theme.t2
font.family: Theme.fontUi
font.pixelSize: 11
}
@@ -103,12 +103,12 @@ Item {
}
}
- Text { text: "编码"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
+ Text { text: "编码"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: Theme.fsSmall }
Text {
text: "NVENC H.264(D3D12 直接编码,不经 CPU 回读)"
- color: Theme.text2
+ color: Theme.t2
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
}
}
@@ -120,7 +120,7 @@ Item {
Text {
Layout.fillWidth: true
text: "导出尺寸目前由 NR 处理尺寸策略决定;自定义输出分辨率尚未实现。"
- color: Theme.text3
+ color: Theme.t3
font.family: Theme.fontUi
font.pixelSize: 11
wrapMode: Text.WordWrap
@@ -134,13 +134,13 @@ Item {
implicitHeight: 34
radius: 17
color: startHover.hovered ? Qt.lighter(Theme.accent, 1.1) : Theme.accent
- Behavior on color { ColorAnimation { duration: Theme.durationFast } }
+ Behavior on color { ColorAnimation { duration: Theme.durFast } }
Text {
anchors.centerIn: parent
text: veyra.exportRunning ? "导出中…" : "开始导出"
color: Theme.accentInk
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
font.bold: true
}
HoverHandler { id: startHover; cursorShape: Qt.PointingHandCursor }
@@ -155,18 +155,18 @@ Item {
Text {
anchors.centerIn: parent
text: "取消"
- color: Theme.text2
+ color: Theme.t2
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
}
HoverHandler { id: cancelHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: veyra.cancelExport() }
}
Text {
text: veyra.exportStatus
- color: Theme.text2
+ color: Theme.t2
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
}
}
}
diff --git a/qml/Veyra/HomePage.qml b/qml/Veyra/HomePage.qml
index 91a099cc..808e2fc0 100644
--- a/qml/Veyra/HomePage.qml
+++ b/qml/Veyra/HomePage.qml
@@ -1,8 +1,8 @@
-// The empty state: what the app shows before anything is open.
+// 首页, rebuilt from the design (pages-a.js PAGES.home + pages.css .home).
//
-// Clicking the logo anywhere returns here, so this is the anchor of the whole
-// interface. Recent files and the three ways to get a picture in are all here;
-// nothing is buried in a menu.
+// The design is: a large logo, a two-line greeting, a 4-up grid of source cards
+// (164x124 each), a "continue last capture" row, and a row of recent chips.
+// The logo in the dock returns here; there is no other home affordance.
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -11,86 +11,110 @@ Item {
id: root
signal requestPage(string page)
- // The logo sits behind everything, large and faint: the empty state should
- // feel like the product, not like an error page.
- Text {
- anchors.centerIn: parent
- anchors.verticalCenterOffset: -60
- text: "V"
- color: Theme.text1
- opacity: 0.04
- font.family: Theme.fontUi
- font.bold: true
- font.pixelSize: 260
- }
-
ColumnLayout {
anchors.centerIn: parent
- width: Math.min(parent.width - 96, 620)
- spacing: 18
+ spacing: 24
- Text {
+ // .home .mark: 128px wide, with a slow "breathe" glow.
+ Image {
Layout.alignment: Qt.AlignHCenter
- text: "Veyra"
- color: Theme.text1
- font.family: Theme.fontUi
- font.pixelSize: 34
- font.bold: true
- font.letterSpacing: 2
+ source: "logo.png"
+ sourceSize.width: 128
+ fillMode: Image.PreserveAspectFit
+ opacity: 0.9
+ SequentialAnimation on scale {
+ loops: Animation.Infinite
+ NumberAnimation { to: 1.02; duration: 2250; easing.type: Easing.InOutSine }
+ NumberAnimation { to: 1.0; duration: 2250; easing.type: Easing.InOutSine }
+ }
}
- Text {
+
+ // .hello: .h1 plus a muted line.
+ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
- text: veyra.statusText
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ spacing: 6
+ Text {
+ Layout.alignment: Qt.AlignHCenter
+ text: "今天看点什么?"
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsH1
+ font.weight: Font.DemiBold
+ }
+ Text {
+ Layout.alignment: Qt.AlignHCenter
+ text: "选一个片源开始,画质预设和补帧随时在播放栏切换"
+ color: Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ }
}
- // The three sources. Each opens its own dialog; capture and PS5 carry
- // their own settings pages rather than being folded into this one.
+ // .srcgrid: repeat(4, 164px), gap 12.
RowLayout {
Layout.alignment: Qt.AlignHCenter
- Layout.topMargin: 10
- spacing: 10
+ spacing: 12
Repeater {
model: [
- { label: "打开文件", hint: "视频或图片", action: "file" },
- { label: "采集卡", hint: "HDMI 输入", action: "capture" },
- { label: "PS5 串流", hint: "局域网", action: "ps5" },
- { label: "屏幕捕获", hint: "窗口或显示器", action: "screen" }
+ { glyph: "📁", title: "打开视频", sub: "MP4 · MKV · 图片", act: "file" },
+ { glyph: "🎬", title: "采集卡", sub: "HDMI 采集设备", act: "capture" },
+ { glyph: "🎮", title: "PS5 串流", sub: "局域网串流", act: "ps5" },
+ { glyph: "🖥", title: "屏幕捕获", sub: "窗口或显示器", act: "screen" }
]
delegate: Rectangle {
required property var modelData
- implicitWidth: 136
- implicitHeight: 84
- radius: Theme.radiusCard
- color: hover.hovered ? Theme.card2 : Theme.card
+ // .srccard: 164x124, radius 14, content pinned top and bottom.
+ implicitWidth: 164
+ implicitHeight: 124
+ radius: Theme.rCard
+ color: cardHover.hovered ? Theme.card2 : Theme.card
border.width: 1
- border.color: hover.hovered ? Theme.accent : Theme.stroke
- Behavior on color { ColorAnimation { duration: Theme.durationFast } }
- Behavior on border.color { ColorAnimation { duration: Theme.durationFast } }
+ border.color: cardHover.hovered ? Theme.stroke2 : Theme.stroke
+ // .srccard:hover { transform: translateY(-4px) }
+ y: cardHover.hovered ? -4 : 0
+ Behavior on y { NumberAnimation { duration: 500; easing.bezierCurve: Theme.spring } }
+ scale: cardTap.pressed ? 0.97 : 1.0
+ Behavior on scale { NumberAnimation { duration: 500; easing.bezierCurve: Theme.spring } }
+
ColumnLayout {
- anchors.centerIn: parent
- spacing: 2
- Text {
- Layout.alignment: Qt.AlignHCenter
- text: modelData.label
- color: Theme.text1
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ anchors.fill: parent
+ anchors.margins: 14
+ spacing: 0
+ Rectangle {
+ // .srccard .ico: 34x34, radius 10, translucent plate.
+ implicitWidth: 34
+ implicitHeight: 34
+ radius: 10
+ color: Qt.rgba(1, 1, 1, 0.06)
+ Text {
+ anchors.centerIn: parent
+ text: modelData.glyph
+ font.pixelSize: 16
+ }
}
- Text {
- Layout.alignment: Qt.AlignHCenter
- text: modelData.hint
- color: Theme.text3
- font.family: Theme.fontUi
- font.pixelSize: 10
+ Item { Layout.fillHeight: true }
+ ColumnLayout {
+ spacing: 3
+ Text {
+ text: modelData.title
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ font.weight: Font.Medium
+ }
+ Text {
+ text: modelData.sub
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsSmall
+ }
}
}
- HoverHandler { id: hover; cursorShape: Qt.PointingHandCursor }
+ HoverHandler { id: cardHover; cursorShape: Qt.PointingHandCursor }
TapHandler {
+ id: cardTap
onTapped: {
- switch (modelData.action) {
+ switch (modelData.act) {
case "file": veyra.openFileDialog(); break
case "capture": veyra.openCaptureDialog(); break
case "ps5": veyra.openPs5Dialog(); break
@@ -102,47 +126,90 @@ Item {
}
}
- // Recent files. Shown only when there are some, so a first run is clean.
- ColumnLayout {
- Layout.fillWidth: true
- Layout.topMargin: 14
- spacing: 4
+ // .resume: 692 wide, an accent-tinted gradient plate, shown only when a
+ // capture session was actually used before. Nothing invented: the text is
+ // the recorded session, and the row is absent when there is none.
+ Rectangle {
+ Layout.alignment: Qt.AlignHCenter
+ visible: veyra.hasCaptureSession
+ implicitWidth: 692
+ implicitHeight: 54
+ radius: 14
+ border.width: 1
+ border.color: Theme.stroke
+ gradient: Gradient {
+ orientation: Gradient.Horizontal
+ GradientStop { position: 0.0; color: Theme.accentSoft }
+ GradientStop { position: 1.0; color: Qt.rgba(1, 1, 1, 0.03) }
+ }
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 14
+ anchors.rightMargin: 10
+ spacing: 14
+ Rectangle {
+ implicitWidth: 34; implicitHeight: 34; radius: 10
+ color: Theme.accentSoft
+ Text { anchors.centerIn: parent; text: "🎮"; font.pixelSize: 15; color: Theme.accent }
+ }
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 2
+ Text {
+ text: "继续上次"
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ font.weight: Font.DemiBold
+ }
+ Text {
+ Layout.fillWidth: true
+ text: veyra.captureSessionSummary
+ color: Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: 12
+ elide: Text.ElideRight
+ }
+ }
+ VButton {
+ text: "开始"
+ primary: true
+ onClicked: veyra.resumeCaptureSession()
+ }
+ }
+ }
+
+ // .recent: a row of chips, present only when there are recent files.
+ RowLayout {
+ Layout.alignment: Qt.AlignHCenter
visible: veyra.recentFiles.length > 0
+ spacing: 8
Text {
- text: "最近打开"
- color: Theme.text3
+ text: "最近"
+ color: Theme.t3
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsBody
}
Repeater {
model: veyra.recentFiles
delegate: Rectangle {
required property var modelData
- Layout.fillWidth: true
- implicitHeight: 30
- radius: 6
- color: rowHover.hovered ? Theme.card2 : "transparent"
- RowLayout {
- anchors.fill: parent
- anchors.leftMargin: 10
- anchors.rightMargin: 10
- Text {
- Layout.fillWidth: true
- text: modelData.label
- color: modelData.exists ? Theme.text1 : Theme.text3
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
- elide: Text.ElideMiddle
- }
- Text {
- visible: !modelData.exists
- text: "已移动"
- color: Theme.text3
- font.family: Theme.fontUi
- font.pixelSize: 10
- }
+ implicitWidth: chipText.implicitWidth + 22
+ implicitHeight: 28
+ radius: 99
+ color: chipHover.hovered ? Qt.rgba(1, 1, 1, 0.08) : Qt.rgba(1, 1, 1, 0.04)
+ border.width: 1
+ border.color: Theme.stroke
+ Text {
+ id: chipText
+ anchors.centerIn: parent
+ text: modelData.label
+ color: chipHover.hovered ? Theme.t1 : Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: 12
+ elide: Text.ElideMiddle
}
- HoverHandler { id: rowHover; cursorShape: Qt.PointingHandCursor }
+ HoverHandler { id: chipHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: if (modelData.exists) veyra.openPath(modelData.path) }
}
}
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 1598cfe7..b41e898d 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -1,15 +1,17 @@
-// The application shell.
+// The application shell, rebuilt from the approved design.
//
-// The window is frameless with a small radius (Windows' own default is small),
-// because the previous build's large rounding was rejected. The video area is
-// its own item and is NEVER clipped or rounded: rounding crops the picture.
+// Structure comes from the prototype (index.html + app.css + board.js):
+// * a frameless window with the small 8px radius;
+// * a hidden top dock that drops in when the pointer reaches the top edge;
+// * one page visible at a time: home / min / pro / node / exp / set;
+// * in cinema mode the WINDOW ITSELF snaps to the film's aspect ratio so the
+// picture has no letterbox bars. The prototype's own technical note says the
+// window must resize to the film when a file opens (capture cards and games
+// are 16:9), and its fitAspect() adds BAR_BELOW = 46 for the control pill.
//
-// Layout of the shell, top to bottom:
-// * the top dock, hidden until the pointer reaches the top edge;
-// * the page area, which swaps between home / minimal / pro / node / export /
-// settings;
-// * nothing else. The video is a native window placed over `videoHost` by
-// apps/veyra-qml/main.cpp, so it is not part of this scene graph.
+// The video is not in this scene graph. It stays the native D3D12 child window
+// that apps/veyra-qml/main.cpp places over the item named "videoHost"; Qt hosts
+// it and never composites it, which is what preserved present cost in S3.
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -18,195 +20,181 @@ Window {
id: root
width: 1280
height: 800
- minimumWidth: 880
- minimumHeight: 560
+ minimumWidth: 720
+ minimumHeight: 260
visible: true
color: "transparent"
flags: Qt.Window | Qt.FramelessWindowHint
title: "Veyra " + veyra.version
- // The current page. Changing it is what the dock and the engine's
- // `navigate` signal both drive.
+ // Page ids match the prototype's PAGES keys so a design screenshot and an
+ // app screenshot can be compared under the same name.
property string page: "home"
+ readonly property bool cinema: page === "min"
- // The window background: deep black with a slight gradient, replacing the
- // old translucent glass. This has to be an item, not Window.color: a
- // frameless window cannot carry a gradient, and without this the desktop
- // shows straight through the app.
+ // Cinema geometry, straight from the prototype: the picture is width/aspect
+ // and the window is that plus the lower half of the control pill.
+ property real filmAspect: 2.39
+ readonly property int barBelow: 46
+ readonly property real pictureHeight: Math.round(width / filmAspect)
+
+ function fitToFilm(aspect) {
+ if (aspect > 0.2 && aspect < 5.0) filmAspect = aspect
+ if (cinema) height = Math.round(pictureHeight + barBelow)
+ }
+ // .vy.cine transition: height .7s var(--spring-soft)
+ Behavior on height {
+ enabled: root.cinema
+ NumberAnimation { duration: 700; easing.bezierCurve: Theme.springSoft }
+ }
+ onWidthChanged: if (cinema) height = Math.round(pictureHeight + barBelow)
+ onPageChanged: {
+ if (cinema) height = Math.round(pictureHeight + barBelow)
+ else if (height < 600) height = 800
+ // The video rect follows the page, and it must be settled before the
+ // engine opens anything: it samples the window's client size once.
+ videoHost.update()
+ }
+
+ // Background: pure black in cinema mode (the picture is the window), the
+ // three-stop gradient otherwise - the prototype's .vy / .vy.cine split.
Rectangle {
id: backdrop
anchors.fill: parent
- radius: Theme.radiusWindow
+ radius: Theme.rWindow
gradient: Gradient {
- GradientStop { position: 0.0; color: Theme.backgroundTop }
- GradientStop { position: 0.45; color: Theme.backgroundMid }
- GradientStop { position: 1.0; color: Theme.background }
+ GradientStop { position: 0.0; color: Theme.bgInner }
+ GradientStop { position: 0.45; color: Theme.bgMid }
+ GradientStop { position: 1.0; color: Theme.bgOuter }
}
- // A hairline edge, so the small radius reads against a dark desktop.
border.width: 1
- border.color: Theme.stroke2
+ border.color: root.cinema ? "transparent" : Theme.stroke
}
- // The one place the native video window sits. There must be exactly ONE item
- // named videoHost in the tree: main.cpp finds it by name, and an earlier
- // version had a copy in each page, so the engine bound its swapchain to a
- // hidden page's zero-sized item and presented into a 1x1 window.
- //
- // The pages do not own the video; they declare where it should go (an item
- // named videoArea) and this follows the active page.
+ // The one host item for the native video window; main.cpp finds it by name.
+ // Exactly one must exist in the tree: an earlier version had a copy in each
+ // page and the engine bound its swapchain to a hidden, zero-sized one.
Item {
id: videoHost
objectName: "videoHost"
- // Visible on every video page, not only once a source is open. It has to
- // be visible and correctly sized BEFORE the engine creates its swapchain:
- // the swapchain is built from this window's client size, and gating it on
- // hasSource meant the engine built it from a hidden 0x0 window and
- // presented into a 1x1 surface.
- visible: root.pageIsVideo
- z: 1
+ visible: false // geometry proxy; the native window draws pixels
+ function update() {
+ const r = root.videoRect()
+ x = r.x; y = r.y; width = r.width; height = r.height
+ }
}
- readonly property bool pageIsVideo: page === "minimal" || page === "pro" || page === "node"
-
- // Finds the video area of the page that is actually showing. Deliberately
- // scoped to the current page: reading every page's area is what caused the
- // 1x1 bug in the first place.
- //
- // The position is computed here rather than read from a child item's
- // geometry, because the page does not lay itself out until the frame after
- // the switch. On the frame the user opens a file, every child item still
- // reports 0x0, and the presenter then builds a 1x1 swapchain. So the host's
- // rect is derived from the same expressions the pages use, which are known
- // synchronously.
- function updateVideoHost() {
- // Computed from `page` directly, NOT from the pageIsVideo property: this
- // runs from onPageChanged, and a binding on `page` has not re-evaluated
- // at that point. Reading the property here returned the PREVIOUS page's
- // answer, so switching to a video page left the host at 0x0 and the
- // presenter built a 1x1 swapchain.
- const isVideo = (page === "minimal" || page === "pro" || page === "node")
- if (!isVideo) {
- videoHost.width = 0
- videoHost.height = 0
- return
- }
- if (page === "minimal") {
- videoHost.x = 0
- videoHost.y = 0
- videoHost.width = root.width
- videoHost.height = root.height
- } else if (page === "pro") {
- // Pro: full height on the left, the effect panel is a fixed 360 wide.
- videoHost.x = 0
- videoHost.y = 0
- videoHost.width = Math.max(1, root.width - 360)
- videoHost.height = Math.max(1, root.height - 44)
- } else {
- // Node: video on top, 40px toolbar between it and the canvas below.
- videoHost.x = 0
- videoHost.y = 0
- videoHost.width = Math.max(1, root.width)
- videoHost.height = Math.max(1, Math.round(Math.max(220, root.height * 0.42)))
+ // Where the picture sits, per page, computed from the design's own layout
+ // numbers rather than read from a laid-out child. A child reports 0x0 on the
+ // frame the user opens a file, and that once produced a 1x1 swapchain.
+ function videoRect() {
+ switch (page) {
+ case "min":
+ // .min .stage: full width, height = the picture height.
+ return { x: 0, y: 0, width: width, height: Math.round(pictureHeight) }
+ case "pro":
+ // .pro grid: 1fr 376px, gap 10, padding 14. The video wrap is column
+ // 1 row 2; .meters below it is a fixed 172px; .pro-head is 32.
+ return { x: 14,
+ y: 14 + 32 + 10,
+ width: Math.max(1, width - 376 - 14 * 2 - 10 - 14),
+ height: Math.max(1, height - 14 * 2 - 32 - 10 - 172 - 10) }
+ case "node":
+ // .nodeview padding 14; .nv-top is a fixed 330px, minus its 40px bar.
+ return { x: 14, y: 14, width: Math.max(1, width - 28), height: 330 - 40 }
+ case "exp":
+ // .exp grid: 250px 1fr 330px; the video is column 2 row 2.
+ return { x: 14 + 250 + 10,
+ y: 14 + 32 + 10,
+ width: Math.max(1, width - 250 - 330 - 14 * 2 - 20),
+ height: Math.max(1, height - 14 * 2 - 32 - 10 - 120 - 10) }
+ default:
+ return { x: 0, y: 0, width: 0, height: 0 }
}
}
- onPageChanged: updateVideoHost()
- onWidthChanged: updateVideoHost()
- onHeightChanged: updateVideoHost()
-
- // Every page is instantiated once and kept alive: switching pages must not
- // rebuild the chain editor or lose a half-typed preset name.
+ // Pages live for the whole session so switching never loses a half-edited
+ // chain; only the visible page owns the video window.
StackLayout {
id: pages
anchors.fill: parent
currentIndex: {
switch (root.page) {
- case "minimal": return 1
+ case "min": return 1
case "pro": return 2
case "node": return 3
- case "export": return 4
- case "settings": return 5
+ case "exp": return 4
+ case "set": return 5
default: return 0
}
}
- HomePage { onRequestPage: page => root.page = page }
- MinimalPage { onRequestPage: page => root.page = page }
- ProPage { onRequestPage: page => root.page = page }
- NodePage { onRequestPage: page => root.page = page }
- ExportPage { onRequestPage: page => root.page = page }
- SettingsPage { onRequestPage: page => root.page = page }
+ HomePage { onRequestPage: p => root.page = p }
+ MinimalPage {
+ onRequestPage: p => root.page = p
+ onRequestAspect: aspect => root.fitToFilm(aspect)
+ }
+ ProPage { onRequestPage: p => root.page = p }
+ NodePage { onRequestPage: p => root.page = p }
+ ExportPage { onRequestPage: p => root.page = p }
+ SettingsPage { onRequestPage: p => root.page = p }
}
- // The dock floats above the pages and hides itself again on a timer.
+ // The dock floats above every page and retracts on its own.
TopDock {
id: dock
anchors.horizontalCenter: parent.horizontalCenter
currentPage: root.page
- onRequestPage: page => root.page = page
+ onRequestPage: p => root.page = p
}
- // Transient notices from the engine: a refused chain edit, a finished
- // export, a failed open. Shown once and gone; no dialog to dismiss.
+ // Toasts: a refused edit, a finished export, a failed open.
Rectangle {
id: toast
- property string text: ""
+ property string message: ""
property bool isError: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
- anchors.bottomMargin: 28
- width: Math.min(toastText.implicitWidth + 32, root.width - 64)
- height: tostRow.implicitHeight + 20
- radius: Theme.radiusControl
- color: toast.isError ? "#2A1416" : Theme.card2
+ anchors.bottomMargin: 24
+ width: Math.min(toastText.implicitWidth + 28, root.width - 48)
+ height: toastText.implicitHeight + 18
+ radius: 9
+ color: toast.isError ? "#2A1414" : "#132218"
border.width: 1
- border.color: toast.isError ? Theme.err : Theme.stroke2
+ border.color: toast.isError ? Qt.rgba(1, 0.365, 0.365, 0.4) : Qt.rgba(0.239, 0.863, 0.518, 0.35)
opacity: 0
visible: opacity > 0.01
- // A spring pop-in, an eased fade-out: arriving should feel alive, leaving
- // should not linger over the picture.
- Behavior on opacity {
- NumberAnimation { duration: Theme.durationNormal; easing.bezierCurve: Theme.easeOut }
- }
- function show(message, error) {
- toast.text = message
- toast.isError = error
- toast.opacity = 1
- hideTimer.restart()
- }
- Timer { id: hideTimer; interval: 4200; onTriggered: toast.opacity = 0 }
- RowLayout {
- id: tostRow
+ Behavior on opacity { NumberAnimation { duration: Theme.durNormal } }
+ function show(m, bad) { toast.message = m; toast.isError = bad; toast.opacity = 1; toastTimer.restart() }
+ Timer { id: toastTimer; interval: 4200; onTriggered: toast.opacity = 0 }
+ Text {
+ id: toastText
anchors.centerIn: parent
- spacing: 8
- Rectangle {
- width: 8; height: 8; radius: 4
- color: toast.isError ? Theme.err : Theme.ok
- Layout.alignment: Qt.AlignVCenter
- }
- Text {
- id: toastText
- text: toast.text
- color: Theme.text1
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
- wrapMode: Text.NoWrap
- }
+ width: parent.width - 20
+ text: toast.message
+ color: toast.isError ? "#FFC9C9" : "#BDF3D2"
+ font.family: Theme.fontUi
+ font.pixelSize: 12
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
}
}
Connections {
target: veyra
function onNotice(text, isError) { toast.show(text, isError) }
- function onNavigate(page) { root.page = page }
+ function onNavigate(p) { root.page = (p === "export" ? "exp" : p) }
}
- // The bridge drives page changes from engine-side commands too, so the dock
- // and the engine never disagree about where the user is. The host rect is
- // settled here as well: it must be correct before the first open, not one
- // frame later.
- Component.onCompleted: {
- if (!veyra.hasSource) root.page = "home"
- updateVideoHost()
+ // The film's aspect drives the window in cinema mode. Reported only: the
+ // engine's own values, never an invented ratio.
+ Connections {
+ target: veyra
+ function onSnapshotChanged() {
+ if (veyra.sourceAspect > 0.2 && Math.abs(veyra.sourceAspect - root.filmAspect) > 0.02)
+ root.fitToFilm(veyra.sourceAspect)
+ }
}
+
+ Component.onCompleted: videoHost.update()
}
diff --git a/qml/Veyra/MinimalPage.qml b/qml/Veyra/MinimalPage.qml
index 16037c58..bee5c813 100644
--- a/qml/Veyra/MinimalPage.qml
+++ b/qml/Veyra/MinimalPage.qml
@@ -1,14 +1,12 @@
-// 极简模式: the video, and almost nothing else.
+// 极简模式, rebuilt from the design (pages-a.js PAGES.min + pages.css .min/.cine-bar).
//
-// Two rules the user set that drive this whole file:
-// * NO black bars around the video. The video host fills the page and the
-// controls sit ON it, fading with the pointer, rather than reserving a band
-// that shows the window background.
-// * "画质" is called 预设, because that is what it is: a preset, not a single
-// quality slider.
+// The design's whole point here: the window snaps to the film's aspect ratio (no
+// letterbox bars), and a large rounded control pill straddles the bottom edge of
+// the picture - half on the picture, half below it. The pill is a 3-column grid
+// (230px | 1fr | 230px) at min(860px, 100% - 48px), 92px tall, radius 30.
//
-// The video is a native D3D12 window placed over the `videoHost` item by
-// apps/veyra-qml/main.cpp. This page only says where that item goes.
+// The window resize itself is Main.qml's job (it owns the window); this page only
+// reports the film aspect and draws the bar.
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -17,136 +15,273 @@ Item {
id: root
signal requestPage(string page)
- property bool chromeVisible: true
- Timer {
- id: hideChrome
- interval: 2600
- onTriggered: if (!pointerHover.hovered && !progressHover.hovered) root.chromeVisible = false
- }
+ // Where the picture ends and the pill straddles. Main.qml sets the window
+ // height to pictureHeight + 46, so the bar's top edge is pictureHeight - 46.
+ readonly property real pictureHeight: parent ? parent.height - 46 : 0
- HoverHandler {
- id: pointerHover
- onHoveredChanged: {
- root.chromeVisible = hovered
- if (hovered) hideChrome.restart()
- }
- }
+ // --- the picture ------------------------------------------------------
+ // .min .stage: full width, the picture height, radius 8 (the window radius),
+ // pure black behind. The native video window is placed here by main.cpp; the
+ // radius applies to the black plate, never to the video, because rounding the
+ // picture crops it.
+ Rectangle {
+ id: stage
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ height: root.pictureHeight
+ radius: Theme.rWindow
+ color: Theme.videoBlack
+ clip: true
- // The video itself. Square corners, no radius, no margin: rounding or
- // insetting this would crop or letterbox the picture.
- Item {
- id: videoHost
- objectName: "videoArea"
- anchors.fill: parent
+ Text {
+ anchors.centerIn: parent
+ visible: !veyra.hasSource
+ text: "选择一个片源开始"
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsH3
+ }
}
- // The picture is letterboxed by the engine into this area, so the page
- // background is only visible while nothing is open.
- Text {
- anchors.centerIn: parent
- visible: !veyra.hasSource
- text: veyra.statusText
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
- }
+ // --- the control pill -------------------------------------------------
+ // .cine-bar: min(860px, 100% - 48px), 92px, radius 30, top = pictureHeight-46.
+ Rectangle {
+ id: cineBar
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: Math.min(860, root.width - 48)
+ height: 92
+ y: root.pictureHeight - 46
+ radius: 30
+ color: Qt.rgba(22 / 255, 22 / 255, 26 / 255, 0.86)
+ border.width: 1
+ border.color: Qt.rgba(1, 1, 1, 0.1)
+ visible: veyra.hasSource
- // --- controls, floating on the picture --------------------------------
- ColumnLayout {
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.margins: 16
- spacing: 8
- opacity: root.chromeVisible ? 1 : 0
- Behavior on opacity { NumberAnimation { duration: Theme.durationNormal; easing.bezierCurve: Theme.easeOut } }
-
- TimingBar {
- Layout.fillWidth: true
- visible: veyra.running
- stages: [
- { label: "调度", ms: veyra.lateMs, color: Theme.warn, measured: veyra.submitFpsKnown },
- { label: "处理", ms: veyra.lateP95Ms, color: Theme.accent, measured: veyra.submitFpsKnown },
- { label: "呈现", ms: 0, color: Theme.ok, measured: false }
- ]
+ // barIn: opacity 0, translate 30px, scale .94 -> settled
+ opacity: 0
+ SequentialAnimation on opacity {
+ running: cineBar.visible
+ PauseAnimation { duration: 120 }
+ NumberAnimation { to: 1.0; duration: 800; easing.bezierCurve: Theme.spring }
}
- Rectangle {
- Layout.fillWidth: true
- implicitHeight: 56
- radius: Theme.radiusCard
- color: Qt.rgba(0.07, 0.07, 0.08, 0.82)
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 14
+ anchors.rightMargin: 18
+ spacing: 18
+ // --- left: artwork + title (230px) ---------------------------
RowLayout {
- anchors.fill: parent
- anchors.leftMargin: 14
- anchors.rightMargin: 14
- spacing: 12
-
- // Play / pause. The spring scale is the one place the interface
- // is allowed to be playful.
- Text {
- text: veyra.paused || !veyra.running ? "▶" : "❚❚"
- color: Theme.text1
- font.pixelSize: 18
- HoverHandler { cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: veyra.togglePlayPause() }
- scale: playTap.pressed ? 0.85 : 1.0
- Behavior on scale { NumberAnimation { duration: Theme.durationNormal; easing.bezierCurve: Theme.spring } }
- TapHandler { id: playTap }
+ Layout.preferredWidth: 230
+ Layout.fillHeight: true
+ spacing: 10
+ Rectangle {
+ implicitWidth: 46; implicitHeight: 46; radius: 12
+ color: Theme.videoBlack
+ border.width: 1
+ border.color: Theme.stroke
+ }
+ ColumnLayout {
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter
+ spacing: 2
+ Text {
+ Layout.fillWidth: true
+ text: veyra.sourceName.length > 0 ? veyra.sourceName : "未打开"
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: 13
+ font.weight: Font.DemiBold
+ elide: Text.ElideRight
+ }
+ Text {
+ Layout.fillWidth: true
+ text: veyra.sourceSummary
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ elide: Text.ElideRight
+ }
}
+ }
+
+ // --- middle: transport + seek --------------------------------
+ ColumnLayout {
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignVCenter
+ spacing: 4
+
+ RowLayout {
+ Layout.alignment: Qt.AlignHCenter
+ spacing: 10
+
+ // .cbtn: 32px round, muted, brightens on hover.
+ component CBtn: Item {
+ id: cbtn
+ property string glyph: ""
+ property string tip: ""
+ // The signal has to be declared: an inline component does not
+ // inherit the TapHandler's signal, so callers cannot assign
+ // onTapped without it.
+ signal tapped()
+ implicitWidth: 32
+ implicitHeight: 32
+ Rectangle {
+ anchors.fill: parent
+ radius: 16
+ color: cHover.hovered ? Qt.rgba(1, 1, 1, 0.08) : "transparent"
+ }
+ Text {
+ anchors.centerIn: parent
+ text: glyph
+ color: cHover.hovered ? "#FFFFFF" : Theme.t2
+ font.pixelSize: 14
+ }
+ scale: cTap.pressed ? 0.86 : 1.0
+ Behavior on scale { NumberAnimation { duration: 400; easing.bezierCurve: Theme.spring } }
+ HoverHandler { id: cHover; cursorShape: Qt.PointingHandCursor }
+ TapHandler { id: cTap; onTapped: cbtn.tapped() }
+ }
- Text {
- text: veyra.positionText
- color: Theme.text2
- font.family: Theme.fontMono
- font.pixelSize: Theme.fontSizeSmall
+ CBtn { glyph: "CC"; onTapped: {} }
+ CBtn { glyph: "⏪"; onTapped: veyra.seekBy(-10) }
+
+ // .play: 40px white circle with the play/pause glyph.
+ Item {
+ implicitWidth: 40
+ implicitHeight: 40
+ Rectangle {
+ anchors.fill: parent
+ radius: 20
+ color: "#FFFFFF"
+ }
+ Text {
+ anchors.centerIn: parent
+ text: (veyra.running && !veyra.paused) ? "❚❚" : "▶"
+ color: "#0A0A0C"
+ font.pixelSize: 14
+ }
+ scale: playTap.pressed ? 0.88 : (playHover.hovered ? 1.06 : 1.0)
+ Behavior on scale { NumberAnimation { duration: 450; easing.bezierCurve: Theme.spring } }
+ HoverHandler { id: playHover; cursorShape: Qt.PointingHandCursor }
+ TapHandler { id: playTap; onTapped: veyra.togglePlayPause() }
+ }
+
+ CBtn { glyph: "⏩"; onTapped: veyra.seekBy(10) }
+ CBtn { glyph: "♪"; onTapped: {} }
}
- // Seek bar. Dragging seeks on release, not continuously: a seek
- // per pixel would queue rebuilds the engine cannot keep up with.
- Slider {
- id: seek
+ // .seekrow: mono times either side of the rail.
+ RowLayout {
Layout.fillWidth: true
- from: 0
- to: Math.max(1, veyra.duration)
- value: veyra.position
- onMoved: if (!pressed) veyra.seekTo(value)
- HoverHandler { id: progressHover; cursorShape: Qt.PointingHandCursor }
+ spacing: 10
+ Text {
+ text: veyra.positionText
+ color: Theme.t3
+ font.family: Theme.fontMono
+ font.pixelSize: 10
+ }
+ Item {
+ Layout.fillWidth: true
+ implicitHeight: 14
+ Rectangle {
+ id: rail
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ height: seekHover.hovered ? 6 : 3
+ radius: 9
+ color: Qt.rgba(1, 1, 1, 0.14)
+ Behavior on height { NumberAnimation { duration: 300; easing.bezierCurve: Theme.spring } }
+ Rectangle {
+ width: parent.width * Math.max(0, Math.min(1, veyra.progress))
+ height: parent.height
+ radius: 9
+ color: "#FFFFFF"
+ }
+ }
+ HoverHandler { id: seekHover; cursorShape: Qt.PointingHandCursor }
+ TapHandler {
+ onTapped: point => {
+ const f = Math.max(0, Math.min(1, point.position.x / width))
+ veyra.seekTo(f * veyra.duration)
+ }
+ }
+ }
+ Text {
+ text: veyra.durationText
+ color: Theme.t3
+ font.family: Theme.fontMono
+ font.pixelSize: 10
+ }
}
+ }
- Text {
- text: veyra.durationText
- color: Theme.text2
- font.family: Theme.fontMono
- font.pixelSize: Theme.fontSizeSmall
+ // --- right: preset, volume, fullscreen (230px) ---------------
+ RowLayout {
+ Layout.preferredWidth: 230
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
+ spacing: 6
+
+ // .pill with a status dot: the dot reports the engine's state, and
+ // the label is the preset actually in use.
+ VPill {
+ key: ""
+ value: veyra.currentPresetName
+ onClicked: presetMenu.popup()
+ Rectangle {
+ width: 7; height: 7; radius: 3.5
+ color: veyra.failed ? Theme.err : veyra.captureRecovering ? Theme.warn : Theme.ok
+ }
}
- // 预设, not 画质.
- Rectangle {
- implicitWidth: presetRow.implicitWidth + 18
- implicitHeight: 30
- radius: 15
- color: presetHover.hovered ? Theme.card3 : Theme.card2
+ Item {
+ implicitWidth: 92
+ implicitHeight: 20
RowLayout {
- id: presetRow
- anchors.centerIn: parent
+ anchors.fill: parent
spacing: 6
- Text { text: "预设"; color: Theme.text1; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
- Text { text: "▾"; color: Theme.text3; font.pixelSize: 10 }
+ Text { text: "🔊"; color: Theme.t2; font.pixelSize: 12 }
+ VSlider {
+ Layout.fillWidth: true
+ from: 0; to: 1; value: veyra.volume
+ onMoved: veyra.volume = value
+ }
}
- HoverHandler { id: presetHover; cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: root.requestPage("settings") }
}
- Text {
- text: "⛶"
- color: Theme.text2
- font.pixelSize: 16
+ Item {
+ implicitWidth: 32; implicitHeight: 32
+ Text {
+ anchors.centerIn: parent
+ text: "⛶"
+ color: Theme.t2
+ font.pixelSize: 14
+ }
HoverHandler { cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: root.requestPage("pro") }
}
}
}
}
+
+ // The preset menu: list presets and node presets in one menu, as designed.
+ Menu {
+ 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)
+ }
+ }
+ }
+
+ // Report the film aspect upward so the window can snap to it.
+ onPictureHeightChanged: if (veyra.sourceAspect > 0.2) root.requestAspect(veyra.sourceAspect)
+ signal requestAspect(real aspect)
}
diff --git a/qml/Veyra/NodePage.qml b/qml/Veyra/NodePage.qml
index 6ca206a7..55b274b8 100644
--- a/qml/Veyra/NodePage.qml
+++ b/qml/Veyra/NodePage.qml
@@ -1,157 +1,199 @@
-// 节点模式: a completely separate mode, not a toggle inside 专业模式.
+// 专业 · 节点模式, rebuilt from the design (pages-node.js + pages.css .nodeview).
//
-// Layout the user asked for: video on top, nodes below on a free canvas,
-// parameters edited directly ON the nodes (no side panel), and multiple
-// instances of the same effect allowed (colour at the input and again at the
-// output, for example).
+// Design structure: padding 14; a fixed 330px video card on top with a stats bar
+// at its foot; a 10px split handle; then an infinite canvas with the nodes. The
+// stats bar carries 输入 / 输出 / 显示 fps / 提交 fps / 排队 / 链路总耗时, and each
+// node shows its own cost in its header. A timing strip along the bottom of the
+// canvas colours each stage by its cost, with the remaining budget hatched.
//
-// What is pinned, and why it has to be: 补帧 is always the last stage and RTX
-// Video HDR always sits immediately in front of it. Video HDR turns an SDR frame
-// into an HDR one; anything after it would need HDR-aware handling that only
-// frame generation has. Both are drawn locked and cannot be dragged. Everything
-// else can be arranged freely, and the engine validates any reorder before
-// accepting it.
+// Pinned stages: 补帧 is always last, RTX Video HDR always immediately before it.
+// Both are drawn locked; everything else is freely arrangeable.
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
+import QtQuick.Shapes
Item {
id: root
signal requestPage(string page)
- // Canvas pan/zoom. Node mode is the one place free arrangement is allowed,
- // and the engine writes viewX/viewY back so a layout survives a restart.
property real panX: 0
property real panY: 0
property real zoom: 1.0
+ property int selectedNode: -1
+
+ onPanXChanged: canvasGrid.requestPaint()
+ onPanYChanged: canvasGrid.requestPaint()
+ onZoomChanged: canvasGrid.requestPaint()
ColumnLayout {
anchors.fill: parent
+ anchors.margins: 14
spacing: 0
- // --- video on top --------------------------------------------------
- Item {
+ // --- video card (fixed 330px) --------------------------------------
+ Rectangle {
Layout.fillWidth: true
- Layout.preferredHeight: Math.max(220, root.height * 0.42)
+ Layout.preferredHeight: 330
+ radius: Theme.rCard
+ color: Theme.videoBlack
+ border.width: 1
+ border.color: Theme.stroke
+ clip: true
+ // The native window sits over this area; the bar occupies its foot.
Item {
- id: videoHost
+ id: videoArea
objectName: "videoArea"
- anchors.fill: parent
- visible: root.visible
- }
- Text {
- anchors.centerIn: parent
- visible: !veyra.hasSource
- text: veyra.statusText
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: statsBar.top
+ Text {
+ anchors.centerIn: parent
+ visible: !veyra.hasSource
+ text: veyra.statusText
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsH3
+ }
}
- }
- // --- toolbar -------------------------------------------------------
- Rectangle {
- Layout.fillWidth: true
- implicitHeight: 40
- color: Theme.card
+ // .nv-bar: transport, then the stats strip.
+ Rectangle {
+ id: statsBar
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: 40
+ color: Theme.card
- RowLayout {
- anchors.fill: parent
- anchors.leftMargin: 14
- anchors.rightMargin: 14
- spacing: 10
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 8
+ anchors.rightMargin: 8
+ spacing: 8
- Text {
- text: "节点模式"
- color: Theme.text1
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
- }
- Text {
- text: "双击画布添加效果 · 右键节点删除 · 拖动节点调整位置"
- color: Theme.text3
- font.family: Theme.fontUi
- font.pixelSize: 11
- Layout.fillWidth: true
- }
- Rectangle {
- implicitWidth: 72
- implicitHeight: 26
- radius: 13
- color: backHover.hovered ? Theme.card3 : Theme.card2
- Text {
- anchors.centerIn: parent
- text: "列表模式"
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: 11
+ VButton {
+ icon: true
+ glyph: (veyra.running && !veyra.paused) ? "❚❚" : "▶"
+ onClicked: veyra.togglePlayPause()
+ }
+ VButton { icon: true; glyph: "⏪"; onClicked: veyra.seekBy(-10) }
+ VButton { icon: true; glyph: "⏩"; onClicked: veyra.seekBy(10) }
+
+ // .nv-stats: each entry separated by a hairline, mono numbers.
+ RowLayout {
+ Layout.fillWidth: true
+ spacing: 0
+ Repeater {
+ model: [
+ { k: "输入", v: veyra.sourceSummary, hi: false },
+ { k: "输出", v: veyra.outputSummary, hi: false },
+ { k: "显示 fps", v: veyra.displayFpsKnown ? veyra.displayFps.toFixed(1) : "未测", hi: true },
+ { k: "提交 fps", v: veyra.submitFpsKnown ? veyra.submitFps.toFixed(1) : "未测", hi: false },
+ { k: "排队", v: veyra.queuedFrames.toFixed(1) + " 帧", hi: false },
+ { k: "链路总耗时", v: veyra.chainTotalMs > 0 ? veyra.chainTotalMs.toFixed(1) + " ms" : "未测", hi: false }
+ ]
+ delegate: RowLayout {
+ required property var modelData
+ required property int index
+ spacing: 5
+ Rectangle {
+ implicitWidth: 1; implicitHeight: 12
+ color: Theme.stroke
+ visible: index > 0
+ }
+ Text {
+ text: modelData.k
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 10
+ }
+ Text {
+ text: modelData.v.length > 0 ? modelData.v : "—"
+ color: modelData.hi && veyra.displayFpsKnown ? Theme.ok : Theme.t1
+ font.family: Theme.fontMono
+ font.pixelSize: modelData.hi ? 14 : 12
+ font.weight: Font.DemiBold
+ }
+ }
+ }
}
- HoverHandler { id: backHover; cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: root.requestPage("pro") }
+
+ VButton { text: "列表模式"; onClicked: root.requestPage("pro") }
}
}
}
+ // --- split handle (10px) -------------------------------------------
+ Item {
+ Layout.fillWidth: true
+ Layout.preferredHeight: 10
+ Rectangle {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: 3
+ width: 40; height: 4; radius: 4
+ color: splitHover.hovered ? Theme.accent : Qt.rgba(1, 1, 1, 0.18)
+ }
+ HoverHandler { id: splitHover; cursorShape: Qt.SizeVerCursor }
+ }
+
// --- canvas --------------------------------------------------------
- // White-background infinite canvas was the design prototype; in the app
- // it is a dark canvas because the app is dark. The behaviour is what
- // carried over: pan, zoom, free placement, no fixed grid of slots.
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
- color: Theme.background
+ radius: Theme.rCard
+ color: "#0A0A0D"
+ border.width: 1
+ border.color: Theme.stroke
clip: true
- // A faint dot grid, drawn only as far as the viewport: an "infinite"
- // canvas is a feel, and drawing infinite dots would cost frames.
+ // .canvas dot grid: 22px spacing, drawn over the viewport only, since
+ // an "infinite" canvas is a feel and infinite dots would cost frames.
Canvas {
- id: grid
+ id: canvasGrid
anchors.fill: parent
- opacity: 0.3
onPaint: {
const ctx = getContext("2d")
ctx.reset()
- ctx.fillStyle = Theme.stroke2
- const step = 28 * root.zoom
- if (step < 6) return
- const ox = (root.panX % step + step) % step
- const oy = (root.panY % step + step) % step
+ const step = 22 * root.zoom
+ if (step < 5) return
+ ctx.fillStyle = Qt.rgba(1, 1, 1, 0.08)
+ const ox = ((root.panX % step) + step) % step
+ const oy = ((root.panY % step) + step) % step
for (let x = ox; x < width; x += step)
for (let y = oy; y < height; y += step)
- ctx.fillRect(x, y, 1.5, 1.5)
- }
- Connections {
- target: root
- function onPanXChanged() { grid.requestPaint() }
- function onPanYChanged() { grid.requestPaint() }
- function onZoomChanged() { grid.requestPaint() }
+ ctx.fillRect(x, y, 1.2, 1.2)
}
}
+ // Hint and the right-click affordance.
+ Text {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.margins: 12
+ text: "双击空白处添加效果 · 右键节点删除 · 拖动节点移动"
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ }
+
Item {
id: world
x: root.panX
y: root.panY
- // Zoom via a transform, so node coordinates stay in chain space
- // and the engine never sees a zoomed value.
transform: Scale { origin.x: 0; origin.y: 0; xScale: root.zoom; yScale: root.zoom }
- // Input and output anchors: the chain's ends are part of the
- // map, so it is clear where a stage sits in the pipeline.
+ // Input and output anchors, so the pipeline's ends are visible.
Rectangle {
- x: -180; y: 40; width: 140; height: 56
- radius: Theme.radiusCard
- color: Theme.card2
+ x: -190; y: 30; width: 150; height: 56
+ radius: 10
+ color: "#1D1D22"
border.width: 1
border.color: Theme.stroke2
- Text {
- anchors.centerIn: parent
- text: "输入"
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
- }
+ Text { anchors.centerIn: parent; text: "输入"; color: Theme.t2; font.family: Theme.fontUi; font.pixelSize: Theme.fsBody }
}
Repeater {
@@ -162,28 +204,19 @@ Item {
}
}
- // The output anchor sits after the pinned tail. Its position is
- // the widest node's right edge, so it always reads as "after the
- // chain" rather than floating at a fixed coordinate.
Rectangle {
- x: 60; y: 340; width: 140; height: 56
- radius: Theme.radiusCard
- color: Theme.card2
+ x: 60; y: 380; width: 150; height: 56
+ radius: 10
+ color: "#1D1D22"
border.width: 1
border.color: Theme.stroke2
- Text {
- anchors.centerIn: parent
- text: "输出"
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
- }
+ Text { anchors.centerIn: parent; text: "输出"; color: Theme.t2; font.family: Theme.fontUi; font.pixelSize: Theme.fsBody }
}
}
- // Pan with the middle button or a drag on empty canvas.
+ // Pan on drag of empty canvas; zoom with the wheel (clamped so a
+ // layout cannot be shrunk into nothing).
DragHandler {
- id: panHandler
target: null
onTranslationChanged: {
root.panX += activeTranslation.x
@@ -192,66 +225,84 @@ Item {
}
WheelHandler {
onWheel: event => {
- // Zoom is clamped: node parameters must stay readable, and a
- // canvas that can shrink to nothing is a way to lose a layout.
root.zoom = Math.max(0.4, Math.min(2.0, root.zoom * (event.angleDelta.y > 0 ? 1.1 : 0.9)))
}
}
-
- // Double-click empty canvas to add a stage. A menu of the catalog is
- // less to learn than a palette you drag from.
TapHandler {
acceptedButtons: Qt.LeftButton
onDoubleTapped: addMenu.popup()
}
- Menu {
- id: addMenu
- Repeater {
- model: veyra.effectCatalog
- delegate: MenuItem {
- required property var modelData
- text: modelData.label
- enabled: !modelData.mustBeLast
- onTriggered: veyra.addEffect(modelData.id)
+ // .timing strip: each stage coloured by its cost; the remainder is
+ // drawn hatched, exactly as the design's .tspare does.
+ Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: 12
+ height: 16
+ radius: 5
+ color: Qt.rgba(10 / 255, 10 / 255, 13 / 255, 0.85)
+
+ Row {
+ anchors.fill: parent
+ anchors.margins: 1
+ spacing: 1
+ Repeater {
+ model: veyra.stageTimings
+ delegate: Rectangle {
+ required property var modelData
+ height: parent.height
+ width: modelData.measured ? Math.max(4, parent.width * modelData.fraction) : 24
+ color: modelData.measured ? modelData.color : Qt.rgba(1, 1, 1, 0.12)
+ Text {
+ anchors.centerIn: parent
+ text: modelData.measured ? modelData.label + " " + modelData.ms.toFixed(1) : "未接入"
+ color: Qt.rgba(0, 0, 0, 0.78)
+ font.family: Theme.fontUi
+ font.pixelSize: 10
+ font.weight: Font.DemiBold
+ elide: Text.ElideRight
+ width: parent.width - 6
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
}
}
}
}
}
- // A node with its own parameters on it, which is the whole point of this
- // mode: no side panel, no selection round trip.
+ // A node card: header with its own cost, then its parameters on the card.
component NodeCard: Rectangle {
id: card
required property var node
-
readonly property bool locked: node.mustBeLast === true
x: node.x
y: node.y
- width: 216
- // NR carries the most parameters; other stages are shorter.
- height: node.type === "nrEnhance" ? 244 : 104
- radius: Theme.radiusCard
- color: Theme.card2
+ width: 236
+ height: node.type === "nrEnhance" ? 248 : 104
+ radius: 10
+ color: "#1D1D22"
border.width: 1
- border.color: drag.dragging ? Theme.accent : Theme.stroke
- Behavior on border.color { ColorAnimation { duration: Theme.durationFast } }
+ border.color: root.selectedNode === node.index ? "#FFFFFF" : Qt.rgba(1, 1, 1, 0.1)
+ Behavior on border.color { ColorAnimation { duration: 200 } }
DragHandler {
id: drag
- // A pinned node cannot be dragged: the pipeline order is physics, not
- // preference, and the engine would refuse the move anyway.
enabled: !card.locked
target: null
onActiveTranslationChanged: {
- card.x = Math.max(-600, card.x + activeTranslation.x / root.zoom)
- card.y = Math.max(-400, card.y + activeTranslation.y / root.zoom)
+ card.x = Math.max(-800, card.x + activeTranslation.x / root.zoom)
+ card.y = Math.max(-600, card.y + activeTranslation.y / root.zoom)
}
onActiveChanged: if (!active) veyra.setEffectPosition(card.node.index, card.x, card.y)
}
-
+ TapHandler {
+ acceptedButtons: Qt.LeftButton
+ onTapped: root.selectedNode = card.node.index
+ }
TapHandler {
acceptedButtons: Qt.RightButton
onTapped: if (!card.locked) veyra.removeEffect(card.node.index)
@@ -259,78 +310,105 @@ Item {
ColumnLayout {
anchors.fill: parent
- anchors.margins: 12
- spacing: 6
+ spacing: 0
- RowLayout {
+ // Header: colour plate, title, the node's own cost, the lock, the switch.
+ Rectangle {
Layout.fillWidth: true
- Rectangle {
- width: 8; height: 8; radius: 4
- color: card.node.enabled ? Theme.accent : Theme.text3
- }
- Text {
- Layout.fillWidth: true
- text: card.node.label
- color: Theme.text1
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
- }
- Text {
- visible: card.locked
- text: "🔒"
- font.pixelSize: 11
- opacity: 0.7
- }
- Rectangle {
- width: 30; height: 17; radius: 9
- visible: !card.locked
- color: card.node.enabled ? Theme.accent : Theme.card3
+ implicitHeight: 32
+ radius: 9
+ color: "#26262C"
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 8
+ anchors.rightMargin: 6
+ spacing: 6
+ Rectangle {
+ width: 8; height: 8; radius: 4
+ color: card.node.enabled ? Theme.accent : Theme.t3
+ }
+ Text {
+ Layout.fillWidth: true
+ text: card.node.label
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ font.weight: Font.DemiBold
+ elide: Text.ElideRight
+ }
+ // .ms badge: this node's cost, or "未接入" when it has none.
Rectangle {
- width: 12; height: 12; radius: 6
- color: card.node.enabled ? Theme.accentInk : Theme.text3
- anchors.verticalCenter: parent.verticalCenter
- x: card.node.enabled ? parent.width - width - 2.5 : 2.5
- Behavior on x { NumberAnimation { duration: Theme.durationNormal; easing.bezierCurve: Theme.spring } }
+ implicitWidth: msText.implicitWidth + 12
+ implicitHeight: 18
+ radius: 5
+ color: Qt.rgba(0, 0, 0, 0.35)
+ Text {
+ id: msText
+ anchors.centerIn: parent
+ text: card.node.costMs > 0 ? card.node.costMs.toFixed(1) + " ms" : "未接入"
+ color: card.node.costMs > 0 ? "#FFFFFF" : Theme.t3
+ font.family: Theme.fontMono
+ font.pixelSize: 10
+ font.weight: Font.DemiBold
+ }
}
- TapHandler { onTapped: veyra.setEffectEnabled(card.node.index, !card.node.enabled) }
+ Text { visible: card.locked; text: "🔒"; font.pixelSize: 10; opacity: 0.7 }
}
}
- // Parameters live on the node. Only the stage's own are shown.
+ // Node parameters live on the node itself, per the design.
ColumnLayout {
Layout.fillWidth: true
- spacing: 2
+ Layout.margins: 10
+ spacing: 4
visible: card.node.type === "nrEnhance"
- Text { text: "强度"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: 10 }
- Slider {
+ Text { text: "强度"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 10 }
+ VSlider {
Layout.fillWidth: true
- from: 0; to: 2; value: veyra.nrIntensity
+ from: 0; to: 1; value: veyra.nrIntensity
onMoved: veyra.nrIntensity = value
}
- Text { text: "色调"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: 10 }
- Slider {
+ Text { text: "局部明暗"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 10 }
+ VSlider {
Layout.fillWidth: true
- from: 0; to: 2; value: veyra.nrTone
+ from: 0; to: 1; value: veyra.nrTone
onMoved: veyra.nrTone = value
}
- Text { text: "结构"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: 10 }
- Slider {
+ Text { text: "局部结构"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 10 }
+ VSlider {
Layout.fillWidth: true
- from: 0; to: 2; value: veyra.nrStructure
+ from: 0; to: 1; value: veyra.nrStructure
onMoved: veyra.nrStructure = value
}
- Text { text: "肤色"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: 10 }
- Slider {
- Layout.fillWidth: true
- from: -1; to: 1; value: veyra.nrSkin
- onMoved: veyra.nrSkin = value
- }
+ }
+
+ // A non-NR node shows its summary so the card is not blank.
+ Text {
+ Layout.fillWidth: true
+ Layout.margins: 10
+ visible: card.node.type !== "nrEnhance"
+ text: card.locked ? "固定为最后一步,不能拖动"
+ : (card.node.enabled ? "已启用" : "已关闭")
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ wrapMode: Text.WordWrap
}
Item { Layout.fillHeight: true }
}
}
- Component.onCompleted: veyra.nodeMode = 1
+ Menu {
+ id: addMenu
+ Repeater {
+ model: veyra.effectCatalog
+ delegate: MenuItem {
+ required property var modelData
+ text: modelData.label
+ onTriggered: veyra.addEffect(modelData.id)
+ }
+ }
+ }
}
diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qml
index f2099448..8cb451b8 100644
--- a/qml/Veyra/ProPage.qml
+++ b/qml/Veyra/ProPage.qml
@@ -1,245 +1,890 @@
-// 专业模式: the video on the left, the chain and its parameters on the right.
+// 专业模式 · 列表视图, rebuilt from the design (pages-pro.js + pages.css .pro).
//
-// This is list mode. Per the user's decision it does NOT allow reordering — only
-// adding layers and toggling them — because a dragged chain is how beginners
-// break the pipeline. Free arrangement lives in node mode, which is a separate
-// page rather than a toggle inside this one.
+// The design's grid: 1fr | 376px columns, rows auto | 1fr | auto, gap 10,
+// padding 14. The inspector spans rows 2-3 on the right; the three meters sit
+// under the video at a fixed 172px.
+//
+// The chain order is fixed (SR → NR layers → protect → HDR → 补帧) and is NOT
+// reorderable here: the user's reason was that dragging breaks the pipeline for
+// beginners. Node mode is where free arrangement lives, and it is a separate page
+// reached through the view toggle (which confirms first, per the design).
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
+import QtQuick.Shapes
Item {
id: root
signal requestPage(string page)
+ // Design's st.tab: quality / fg / color / audio / display.
+ property string tab: "quality"
property int selectedEffect: -1
+ // --- header (32px) ----------------------------------------------------
RowLayout {
- anchors.fill: parent
- spacing: 0
+ id: head
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 14
+ height: 32
+ spacing: 8
- // --- video + transport ------------------------------------------
- ColumnLayout {
- Layout.fillWidth: true
- Layout.fillHeight: true
- spacing: 0
+ VButton {
+ glyph: "🎬"
+ text: veyra.isCapture ? "采集卡" : "片源"
+ onClicked: sourceMenu.popup()
+ }
+ VTag { text: veyra.sourceSummary.length > 0 ? veyra.sourceSummary : "未打开" }
+ Item { Layout.fillWidth: true }
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
+ // View toggle. Choosing 节点 asks first, because switching rebuilds the
+ // whole processing chain (design note: 切换需要确认,会重建处理链).
+ VSeg {
+ options: [{ id: "list", label: "列表" }, { id: "node", label: "节点" }]
+ current: "list"
+ onPicked: id => { if (id === "node") switchDialog.open() }
+ }
+ VButton { glyph: "📷"; text: "截图"; onClicked: veyra.takeScreenshot() }
+ VButton {
+ text: "预设:" + veyra.currentPresetName
+ onClicked: presetMenu.popup()
+ }
+ }
- // The native video window is placed over this item by main.cpp.
- // Only the visible page may own it, or two pages would fight for
- // the same HWND.
- Item {
- id: videoHost
- objectName: "videoArea"
- anchors.fill: parent
- visible: root.visible
- }
+ // --- video + transport bar -------------------------------------------
+ Rectangle {
+ id: vwrap
+ anchors.left: parent.left
+ anchors.top: head.bottom
+ anchors.topMargin: 10
+ width: root.width - 376 - 14 * 2 - 10
+ height: root.height - 14 - 32 - 10 - 172 - 10 - 14
+ radius: Theme.rCard
+ color: Theme.card
+ border.width: 1
+ border.color: Theme.stroke
+ clip: true
+
+ // The native video window sits over the top of this; the bar is its foot.
+ Item {
+ id: videoArea
+ objectName: "videoArea"
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ height: parent.height - 34
+ Text {
+ anchors.centerIn: parent
+ visible: !veyra.hasSource
+ text: veyra.statusText
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsH3
+ }
+ }
+
+ // .vbar: mono transport row with source/output tags.
+ RowLayout {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: 34
+ anchors.leftMargin: 10
+ anchors.rightMargin: 10
+ spacing: 10
+ Item {
+ implicitWidth: 28; implicitHeight: 28
Text {
anchors.centerIn: parent
- visible: !veyra.hasSource
- text: veyra.statusText
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
+ text: (veyra.running && !veyra.paused) ? "❚❚" : "▶"
+ color: Theme.t2
+ font.pixelSize: 13
}
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: veyra.togglePlayPause() }
}
-
- Rectangle {
+ Text {
+ text: veyra.positionText
+ color: Theme.t2
+ font.family: Theme.fontMono
+ font.pixelSize: Theme.fsSmall
+ }
+ Item {
Layout.fillWidth: true
- implicitHeight: 44
- color: Qt.rgba(0.07, 0.07, 0.08, 0.9)
- RowLayout {
- anchors.fill: parent
- anchors.leftMargin: 14
- anchors.rightMargin: 14
- spacing: 10
+ implicitHeight: 14
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ height: 3
+ radius: 9
+ color: Qt.rgba(1, 1, 1, 0.14)
+ Rectangle {
+ width: parent.width * Math.max(0, Math.min(1, veyra.progress))
+ height: parent.height
+ radius: 9
+ color: "#FFFFFF"
+ }
+ }
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler {
+ onTapped: point => veyra.seekTo(Math.max(0, Math.min(1, point.position.x / width)) * veyra.duration)
+ }
+ }
+ Text {
+ text: veyra.durationText
+ color: Theme.t2
+ font.family: Theme.fontMono
+ font.pixelSize: Theme.fsSmall
+ }
+ VTag { text: veyra.sourceSummary }
+ VTag { text: veyra.outputSummary }
+ VTag {
+ visible: veyra.fgActive
+ kind: "acc"
+ text: veyra.fgMultiplier + "X"
+ }
+ }
+ }
+
+ // --- meters (fixed 172px, three cards) --------------------------------
+ RowLayout {
+ anchors.left: parent.left
+ anchors.top: vwrap.bottom
+ anchors.topMargin: 10
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 14
+ width: vwrap.width
+ spacing: 10
+
+ // Card 1: signal chain. Reported values only.
+ Rectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.preferredWidth: 1.05
+ radius: Theme.rCard
+ color: Theme.card
+ border.width: 1
+ border.color: Theme.stroke
+ ColumnLayout {
+ anchors.fill: parent
+ anchors.margins: 14
+ spacing: 6
+ VEyebrow { text: "信号" }
+ GridLayout {
+ Layout.fillWidth: true
+ columns: 2
+ columnSpacing: 14
+ rowSpacing: 4
+ Text { text: "输入"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 12 }
Text {
- text: veyra.paused || !veyra.running ? "▶" : "❚❚"
- color: Theme.text1
- font.pixelSize: 16
- HoverHandler { cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: veyra.togglePlayPause() }
+ Layout.fillWidth: true
+ text: veyra.sourceSummary.length > 0
+ ? veyra.sourceSummary + " · " + veyra.sourceFps.toFixed(2)
+ : "—"
+ color: Theme.t1; font.family: Theme.fontMono; font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
}
+ Text { text: "输出"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 12 }
Text {
- text: veyra.positionText
- color: Theme.text2
- font.family: Theme.fontMono
- font.pixelSize: Theme.fontSizeSmall
+ Layout.fillWidth: true
+ text: veyra.outputSummary.length > 0 ? veyra.outputSummary : "—"
+ color: Theme.t1; font.family: Theme.fontMono; font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
}
- Slider {
+ Text { text: "光流"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 12 }
+ Text {
Layout.fillWidth: true
- from: 0
- to: Math.max(1, veyra.duration)
- value: veyra.position
- onMoved: if (!pressed) veyra.seekTo(value)
+ text: veyra.flowBackend.length > 0 ? veyra.flowBackend : "未执行"
+ color: Theme.t1; font.family: Theme.fontMono; font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
}
+ Text { text: "色彩"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 12 }
Text {
- text: veyra.durationText
- color: Theme.text2
- font.family: Theme.fontMono
- font.pixelSize: Theme.fontSizeSmall
+ Layout.fillWidth: true
+ text: veyra.colorStatus.length > 0 ? veyra.colorStatus : "—"
+ color: Theme.t1; font.family: Theme.fontMono; font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
+ elide: Text.ElideRight
}
}
+ Item { Layout.fillHeight: true }
}
}
- // --- effect panel --------------------------------------------------
+ // Card 2: per-stage GPU cost. Only stages the engine actually timed are
+ // listed; a stage with no measurement is drawn as unmeasured.
Rectangle {
- Layout.preferredWidth: 360
+ Layout.fillWidth: true
Layout.fillHeight: true
+ Layout.preferredWidth: 1.5
+ radius: Theme.rCard
color: Theme.card
+ border.width: 1
+ border.color: Theme.stroke
+ ColumnLayout {
+ anchors.fill: parent
+ anchors.margins: 14
+ spacing: 5
+ RowLayout {
+ Layout.fillWidth: true
+ VEyebrow { text: "各阶段 GPU 耗时"; Layout.fillWidth: true }
+ Text {
+ text: "预算 " + veyra.stageBudgetMs.toFixed(1) + " ms / 源帧"
+ color: Theme.t3
+ font.family: Theme.fontMono
+ font.pixelSize: 11
+ }
+ }
+ Repeater {
+ model: veyra.stageTimings
+ delegate: RowLayout {
+ required property var modelData
+ Layout.fillWidth: true
+ spacing: 10
+ Text {
+ Layout.preferredWidth: 44
+ text: modelData.label
+ color: Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsSmall
+ }
+ Item {
+ Layout.fillWidth: true
+ implicitHeight: 5
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ height: 5
+ radius: 9
+ color: Qt.rgba(1, 1, 1, 0.08)
+ Rectangle {
+ width: parent.width * Math.max(0, Math.min(1, modelData.fraction))
+ height: parent.height
+ radius: 9
+ color: modelData.color
+ }
+ }
+ }
+ Text {
+ Layout.preferredWidth: 52
+ text: modelData.measured ? modelData.ms.toFixed(1) + " ms" : "未测量"
+ color: modelData.measured ? Theme.t1 : Theme.t3
+ font.family: Theme.fontMono
+ font.pixelSize: 11
+ horizontalAlignment: Text.AlignRight
+ }
+ }
+ }
+ Item { Layout.fillHeight: true }
+ }
+ }
+ // Card 3: frame rate and cadence.
+ Rectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.preferredWidth: 1.15
+ radius: Theme.rCard
+ color: Theme.card
+ border.width: 1
+ border.color: Theme.stroke
ColumnLayout {
anchors.fill: parent
anchors.margins: 14
- spacing: 12
+ spacing: 6
+ VEyebrow { text: "帧率与节奏" }
+ // The design puts "显示 fps" first and "提交 fps" after it, and its
+ // own note is explicit: a display rate is only real if the system
+ // display event can be read, and when it cannot it must say 未测
+ // rather than reuse the submit rate.
RowLayout {
+ spacing: 6
+ Text {
+ text: veyra.displayFpsKnown ? veyra.displayFps.toFixed(1) : "未测"
+ color: veyra.displayFpsKnown ? Theme.ok : Theme.t3
+ font.family: Theme.fontMono
+ font.pixelSize: 22
+ font.weight: Font.DemiBold
+ }
+ Text { text: "显示 fps"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11 }
+ Rectangle { implicitWidth: 1; implicitHeight: 12; color: Theme.stroke2 }
+ Text {
+ text: veyra.submitFpsKnown ? veyra.submitFps.toFixed(1) : "未测"
+ color: Theme.t1
+ font.family: Theme.fontMono
+ font.pixelSize: 13
+ font.weight: Font.DemiBold
+ }
+ Text { text: "提交"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11 }
+ }
+ GridLayout {
Layout.fillWidth: true
+ columns: 2
+ columnSpacing: 14
+ rowSpacing: 3
+ Text { text: "进程内排队"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 12 }
Text {
- text: "效果链"
- color: Theme.text1
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
Layout.fillWidth: true
+ text: veyra.queuedFrames.toFixed(1) + " 帧"
+ color: Theme.t1; font.family: Theme.fontMono; font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
}
- // Node mode is a different page, and the button says so.
- Rectangle {
- implicitWidth: 72
- implicitHeight: 26
- radius: 13
- color: nodeHover.hovered ? Theme.card3 : Theme.card2
+ Text { text: "跳过源帧"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 12 }
+ Text {
+ Layout.fillWidth: true
+ text: String(veyra.skippedFrames)
+ color: Theme.t1; font.family: Theme.fontMono; font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
+ }
+ }
+ Item { Layout.fillHeight: true }
+ }
+ }
+ }
+
+ // --- inspector (376px, rows 2-3) --------------------------------------
+ Rectangle {
+ id: insp
+ anchors.right: parent.right
+ anchors.top: head.bottom
+ anchors.topMargin: 10
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 14
+ width: 376
+ radius: Theme.rCard
+ color: Theme.card
+ border.width: 1
+ border.color: Theme.stroke
+ clip: true
+
+ ColumnLayout {
+ anchors.fill: parent
+ spacing: 0
+
+ // .insp-tabs: five tabs, equal width, 30px, radius 9.
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.margins: 8
+ spacing: 2
+ Repeater {
+ model: [
+ { id: "quality", label: "画质" },
+ { id: "fg", label: "补帧" },
+ { id: "color", label: "色彩" },
+ { id: "audio", label: "声音" },
+ { id: "display", label: "显示" }
+ ]
+ delegate: Rectangle {
+ required property var modelData
+ Layout.fillWidth: true
+ implicitHeight: 30
+ radius: 9
+ color: root.tab === modelData.id ? Theme.card3
+ : tabHover.hovered ? Qt.rgba(1, 1, 1, 0.04) : "transparent"
+ Behavior on color { ColorAnimation { duration: 200 } }
Text {
anchors.centerIn: parent
- text: "节点模式"
- color: Theme.text2
+ text: modelData.label
+ color: root.tab === modelData.id ? Theme.t1 : Theme.t2
font.family: Theme.fontUi
- font.pixelSize: 11
+ font.pixelSize: Theme.fsBody
+ font.weight: Font.Medium
}
- HoverHandler { id: nodeHover; cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: root.requestPage("node") }
+ HoverHandler { id: tabHover; cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: root.tab = modelData.id }
}
}
+ }
- ChainList {
- id: chainList
- Layout.fillWidth: true
- onSelectedChanged: root.selectedEffect = selected
+ // .chainbar: the processing order, chips joined by arrows. Fixed order:
+ // 补帧 is always last and RTX Video HDR sits immediately before it.
+ Rectangle {
+ Layout.fillWidth: true
+ Layout.leftMargin: 10
+ Layout.rightMargin: 10
+ implicitHeight: chainCol.implicitHeight + 20
+ radius: 12
+ color: Qt.rgba(1, 1, 1, 0.03)
+ border.width: 1
+ border.color: Theme.stroke
+ ColumnLayout {
+ id: chainCol
+ anchors.fill: parent
+ anchors.margins: 10
+ spacing: 7
+ RowLayout {
+ Layout.fillWidth: true
+ VEyebrow { text: "处理顺序"; Layout.fillWidth: true }
+ Text { text: "点击定位"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11 }
+ }
+ Flow {
+ Layout.fillWidth: true
+ spacing: 2
+ Repeater {
+ model: veyra.chain
+ delegate: Row {
+ required property var modelData
+ spacing: 2
+ Text { text: "→"; color: Theme.t3; font.pixelSize: 10; anchors.verticalCenter: parent.verticalCenter }
+ Rectangle {
+ width: chipLabel.implicitWidth + 18
+ height: 24
+ radius: 99
+ color: Theme.card3
+ border.width: 1
+ border.color: Theme.stroke
+ opacity: modelData.enabled ? 1.0 : 0.4
+ Text {
+ id: chipLabel
+ anchors.centerIn: parent
+ text: modelData.label
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: 12
+ font.strikeout: !modelData.enabled
+ }
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: root.selectedEffect = modelData.index }
+ }
+ }
+ }
+ }
}
+ }
- // Adding a stage. The engine refuses anything that would break
- // the pipeline order and explains why under the list.
- Text {
- text: "添加效果"
- color: Theme.text3
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
- }
- Flow {
- Layout.fillWidth: true
+ // Body. Each tab shows the controls the engine actually has; where the
+ // engine has no control yet, the panel says so instead of offering one
+ // that would do nothing.
+ Flickable {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.topMargin: 8
+ contentHeight: body.implicitHeight
+ clip: true
+ ScrollBar.vertical: ScrollBar { }
+
+ ColumnLayout {
+ id: body
+ width: parent.width - 20
+ x: 10
spacing: 6
- Repeater {
- model: veyra.effectCatalog
- delegate: Rectangle {
- required property var modelData
- width: chipText.implicitWidth + 20
- height: 28
- radius: 14
- color: chipHover.hovered ? Theme.card3 : Theme.card2
- border.width: 1
- border.color: modelData.mustBeLast ? Theme.stroke2 : "transparent"
+
+ // --- 画质 -------------------------------------------------
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 6
+ visible: root.tab === "quality"
+
+ VGroup {
+ VRow {
+ label: "超分辨率"
+ VSwitch {
+ checked: veyra.srEnabled
+ onToggled: veyra.srEnabled = checked
+ }
+ }
+ VRow {
+ label: "NR 画面增强"
+ hint: "每层独立参数,最多 4 层"
+ VSwitch {
+ checked: veyra.nrEnabled
+ onToggled: veyra.nrEnabled = checked
+ }
+ }
+ }
+
+ // NR parameters, shown only when NR is on.
+ VGroup {
+ visible: veyra.nrEnabled
+ VRow {
+ label: "模型强度"
+ value: veyra.nrIntensity.toFixed(2)
+ VSlider {
+ implicitWidth: 150
+ from: 0; to: 1; value: veyra.nrIntensity
+ onMoved: veyra.nrIntensity = value
+ }
+ }
+ VRow {
+ label: "局部明暗"
+ value: veyra.nrTone.toFixed(2)
+ VSlider {
+ implicitWidth: 150
+ from: 0; to: 1; value: veyra.nrTone
+ onMoved: veyra.nrTone = value
+ }
+ }
+ VRow {
+ label: "局部结构"
+ value: veyra.nrStructure.toFixed(2)
+ VSlider {
+ implicitWidth: 150
+ from: 0; to: 1; value: veyra.nrStructure
+ onMoved: veyra.nrStructure = value
+ }
+ }
+ VRow {
+ label: "时间域防闪烁"
+ hint: "在 NR 之后稳定残差,默认关闭"
+ VSwitch {
+ checked: veyra.nrTemporal
+ onToggled: veyra.nrTemporal = checked
+ }
+ }
+ }
+
+ // Adding an NR layer. List mode allows adding layers and
+ // toggling them, never reordering.
+ Rectangle {
+ id: addLayer
+ Layout.fillWidth: true
+ implicitHeight: 36
+ radius: 10
+ // A dashed outline as in the design: a Rectangle border
+ // cannot be dashed, so the outline is drawn as a shape.
+ color: addHover.hovered ? Theme.accentSoft : "transparent"
+ Shape {
+ anchors.fill: parent
+ ShapePath {
+ strokeWidth: 1
+ strokeColor: addHover.hovered ? Theme.accent : Qt.rgba(1, 1, 1, 0.2)
+ fillColor: "transparent"
+ strokeStyle: ShapePath.DashLine
+ dashPattern: [5, 4]
+ PathRectangle {
+ x: 0; y: 0
+ width: addLayer.width
+ height: addLayer.height
+ radius: 10
+ }
+ }
+ }
Text {
- id: chipText
anchors.centerIn: parent
- text: "+ " + modelData.label
- color: modelData.experimental ? Theme.experimental : Theme.text2
+ text: "+ 增加 NR 层"
+ color: addHover.hovered ? Theme.accent : Theme.t2
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsBody
+ font.weight: Font.Medium
}
- HoverHandler { id: chipHover; cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: chainList.addEffect(modelData.id) }
+ HoverHandler { id: addHover; cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: veyra.addEffect("nrEnhance") }
+ }
+
+ // A refused edit explains itself here rather than in a modal.
+ Text {
+ Layout.fillWidth: true
+ visible: !veyra.chainValid
+ text: veyra.chainError
+ color: Theme.err
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsSmall
+ wrapMode: Text.WordWrap
}
}
- }
- // Parameters of the selected stage. These are the NR controls;
- // the panel is only shown when a stage is selected so the user is
- // never shown controls that do not apply to what is selected.
- Rectangle {
- Layout.fillWidth: true
- Layout.fillHeight: true
- radius: Theme.radiusCard
- color: Theme.card2
- visible: root.selectedEffect >= 0
- clip: true
-
- Flickable {
- anchors.fill: parent
- anchors.margins: 12
- contentHeight: params.implicitHeight
- clip: true
- ColumnLayout {
- id: params
- width: parent.width
- spacing: 8
+ // --- 补帧 -------------------------------------------------
+ // Per the design: DLSS frame generation and Intel XeSS
+ // (experimental) only. AMD FSR frame generation stays hidden.
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 6
+ visible: root.tab === "fg"
+
+ VGroup {
+ VRow {
+ label: "补帧方式"
+ VSelect {
+ value: veyra.fgBackendName
+ options: [
+ { id: "dlss", label: "DLSS 帧生成" },
+ { id: "xess", label: "Intel XeSS · 实验" }
+ ]
+ onPicked: id => veyra.fgBackendName = id
+ }
+ }
+ VRow {
+ label: "倍率"
+ hint: veyra.fgMaxMultiplier + "X 为上限"
+ VSeg {
+ options: veyra.fgMultiplierChoices
+ current: String(veyra.fgMultiplier)
+ onPicked: id => veyra.fgMultiplier = parseInt(id)
+ }
+ }
+ VRow {
+ label: "严格补帧节奏"
+ hint: "帧同步 · 默认关闭"
+ VSwitch {
+ checked: veyra.fgStrict
+ onToggled: veyra.fgStrict = checked
+ }
+ }
+ }
+ VGroup {
+ VRow {
+ label: "低延迟队列"
+ hint: "减少排队;本机无法验收,不宣称延迟下降"
+ VSwitch {
+ checked: veyra.fgLowQueue
+ onToggled: veyra.fgLowQueue = checked
+ }
+ }
+ }
+ }
+ // --- 色彩 -------------------------------------------------
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 6
+ visible: root.tab === "color"
+ VGroup {
+ VRow {
+ label: "调色"
+ VSwitch {
+ checked: veyra.colorEnabled
+ onToggled: veyra.colorEnabled = checked
+ }
+ }
+ }
+ VGroup {
+ visible: veyra.colorEnabled
+ VRow {
+ label: "曝光(EV)"
+ value: veyra.colorExposure.toFixed(2)
+ VSlider {
+ implicitWidth: 150
+ center: true
+ from: -5; to: 5; value: veyra.colorExposure
+ onMoved: veyra.colorExposure = value
+ }
+ }
+ VRow {
+ label: "对比度"
+ value: String(Math.round(veyra.colorContrast))
+ VSlider {
+ implicitWidth: 150
+ center: true
+ from: -100; to: 100; value: veyra.colorContrast
+ onMoved: veyra.colorContrast = value
+ }
+ }
+ VRow {
+ label: "饱和度"
+ value: String(Math.round(veyra.colorSaturation))
+ VSlider {
+ implicitWidth: 150
+ center: true
+ from: -100; to: 100; value: veyra.colorSaturation
+ onMoved: veyra.colorSaturation = value
+ }
+ }
+ VRow {
+ label: "色温(相对)"
+ value: String(Math.round(veyra.colorTemperature))
+ VSlider {
+ implicitWidth: 150
+ center: true
+ from: -100; to: 100; value: veyra.colorTemperature
+ onMoved: veyra.colorTemperature = value
+ }
+ }
+ }
+ // Honest scope note: the design's colour page is much larger
+ // (curves, mixer, grading wheels, calibration, LUT). Those
+ // controls are not wired to the bridge yet, so this panel
+ // says so rather than showing dead sliders.
+ Rectangle {
+ Layout.fillWidth: true
+ implicitHeight: noteText.implicitHeight + 20
+ radius: 9
+ color: Qt.rgba(0.961, 0.784, 0.294, 0.06)
Text {
- text: "参数"
- color: Theme.text2
+ id: noteText
+ anchors.fill: parent
+ anchors.margins: 10
+ text: "曲线、混色器、颜色分级、校准与 LUT 尚未接入界面;引擎已支持,但本轮未接。"
+ color: Theme.t2
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
+ wrapMode: Text.WordWrap
}
- GridLayout {
- Layout.fillWidth: true
- columns: 2
- columnSpacing: 10
- rowSpacing: 4
-
- Text { text: "强度"; color: Theme.text2; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
- Slider {
- Layout.fillWidth: true
- from: 0; to: 2; value: veyra.nrIntensity
- onMoved: veyra.nrIntensity = value
+ }
+ }
+
+ // --- 声音 -------------------------------------------------
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 6
+ visible: root.tab === "audio"
+ VGroup {
+ VRow {
+ label: "音量"
+ value: Math.round(veyra.volume * 100) + "%"
+ VSlider {
+ implicitWidth: 150
+ from: 0; to: 1; value: veyra.volume
+ onMoved: veyra.volume = value
}
- Text { text: "色调"; color: Theme.text2; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
- Slider {
- Layout.fillWidth: true
- from: 0; to: 2; value: veyra.nrTone
- onMoved: veyra.nrTone = value
+ }
+ VRow {
+ label: "静音"
+ VSwitch {
+ checked: veyra.muted
+ onToggled: veyra.muted = checked
}
- Text { text: "结构"; color: Theme.text2; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
- Slider {
- Layout.fillWidth: true
- from: 0; to: 2; value: veyra.nrStructure
- onMoved: veyra.nrStructure = value
+ }
+ VRow {
+ label: "音频偏移"
+ hint: "正值延后音频"
+ value: veyra.audioOffsetMs + " ms"
+ VSlider {
+ implicitWidth: 150
+ center: true
+ from: -2000; to: 2000; value: veyra.audioOffsetMs
+ onMoved: veyra.audioOffsetMs = Math.round(value)
}
- Text { text: "肤色"; color: Theme.text2; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
- Slider {
- Layout.fillWidth: true
- from: -1; to: 1; value: veyra.nrSkin
- onMoved: veyra.nrSkin = value
+ }
+ }
+ VEyebrow { text: "音轨" }
+ Text {
+ visible: veyra.audioTracks.length === 0
+ text: "当前源没有可选音轨。"
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsSmall
+ }
+ Repeater {
+ model: veyra.audioTracks
+ delegate: Rectangle {
+ required property var modelData
+ Layout.fillWidth: true
+ implicitHeight: 44
+ radius: 12
+ color: Theme.card2
+ border.width: 1
+ border.color: veyra.selectedAudioTrack === modelData.index ? Theme.accent : Theme.stroke
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 12
+ anchors.rightMargin: 12
+ spacing: 12
+ VDot { off: veyra.selectedAudioTrack !== modelData.index }
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 2
+ Text {
+ text: modelData.label
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ }
+ Text {
+ text: modelData.channels > 0 ? modelData.channels + " 声道" : ""
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ }
+ }
}
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: veyra.selectedAudioTrack = modelData.index }
}
+ }
+ }
- Text {
- Layout.topMargin: 6
- text: "时间域防闪烁"
- color: Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ // --- 显示 -------------------------------------------------
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 6
+ visible: root.tab === "display"
+ VGroup {
+ VRow {
+ label: "提交帧率"
+ value: veyra.submitFpsKnown ? veyra.submitFps.toFixed(2) : "未测量"
+ }
+ VRow {
+ label: "显示帧率"
+ hint: "需要系统显示事件才能测得真实值;取不到时显示未测"
+ value: veyra.displayFpsKnown ? veyra.displayFps.toFixed(2) : "未测"
}
- Switch {
- text: "在 NR 后稳定残差(默认关闭)"
- checked: veyra.nrTemporal
- onToggled: veyra.nrTemporal = checked
+ VRow {
+ label: "晚点 P95"
+ value: veyra.lateP95Ms.toFixed(2) + " ms"
+ }
+ VRow {
+ label: "调度等待 P95"
+ value: veyra.scheduleP95Ms.toFixed(2) + " ms"
}
}
}
+
+ Item { Layout.preferredHeight: 12 }
+ }
+ }
+
+ // .insp-foot
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.margins: 10
+ spacing: 8
+ VDot { off: !veyra.running; warn: veyra.captureRecovering; err: veyra.failed }
+ Text {
+ Layout.fillWidth: true
+ text: veyra.statusText
+ color: Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsSmall
+ elide: Text.ElideRight
+ }
+ VButton {
+ ghost: true
+ text: "重置本页"
+ onClicked: veyra.resetCurrentPage()
}
}
}
}
+
+ Menu {
+ 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() }
+ }
+ Menu {
+ id: presetMenu
+ width: 260
+ Repeater {
+ model: veyra.presets
+ delegate: MenuItem {
+ required property var modelData
+ text: modelData.name + (modelData.builtin ? " (内置)" : "")
+ onTriggered: veyra.applyPresetIndex(modelData.index)
+ }
+ }
+ }
+
+ // Switching to node mode rebuilds the chain, so the design asks first.
+ Dialog {
+ id: switchDialog
+ anchors.centerIn: parent
+ modal: true
+ title: "切换到节点模式?"
+ standardButtons: Dialog.Ok | Dialog.Cancel
+ Text {
+ width: 380
+ wrapMode: Text.WordWrap
+ text: "列表与节点是两套独立配置和预设。切换会重建处理链;切回列表时恢复列表原来的设置。"
+ color: Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ }
+ onAccepted: root.requestPage("node")
+ }
}
diff --git a/qml/Veyra/SettingsPage.qml b/qml/Veyra/SettingsPage.qml
index 6cc17c61..1eb71fe0 100644
--- a/qml/Veyra/SettingsPage.qml
+++ b/qml/Veyra/SettingsPage.qml
@@ -23,9 +23,9 @@ Item {
Layout.fillWidth: true
Text {
text: "设置"
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeHeading
+ font.pixelSize: Theme.fsH1
Layout.fillWidth: true
}
}
@@ -43,14 +43,14 @@ Item {
implicitHeight: 30
radius: 15
color: root.tab === index ? Theme.card3 : (tabHover.hovered ? Theme.card2 : "transparent")
- Behavior on color { ColorAnimation { duration: Theme.durationFast } }
+ Behavior on color { ColorAnimation { duration: Theme.durFast } }
Text {
id: tabText
anchors.centerIn: parent
text: modelData
- color: root.tab === index ? Theme.text1 : Theme.text2
+ color: root.tab === index ? Theme.t1 : Theme.t2
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
}
HoverHandler { id: tabHover; cursorShape: Qt.PointingHandCursor }
TapHandler { onTapped: root.tab = index }
@@ -62,7 +62,7 @@ Item {
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
- radius: Theme.radiusCard
+ radius: Theme.rCard
color: Theme.card
visible: root.tab === 0
@@ -73,14 +73,14 @@ Item {
Text {
text: "预设"
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
+ font.pixelSize: Theme.fsH3
}
Text {
Layout.fillWidth: true
text: "保存时勾选包含哪些部分;应用时只覆盖勾选的部分,其余保持当前设置。"
- color: Theme.text3
+ color: Theme.t3
font.family: Theme.fontUi
font.pixelSize: 11
wrapMode: Text.WordWrap
@@ -106,22 +106,22 @@ Item {
Text {
Layout.fillWidth: true
text: modelData.name
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
elide: Text.ElideRight
}
Text {
visible: modelData.builtin
text: "内置"
- color: Theme.text3
+ color: Theme.t3
font.family: Theme.fontUi
font.pixelSize: 10
}
Text {
visible: modelData.nodeMode
text: "节点"
- color: Theme.experimental
+ color: Theme.exp
font.family: Theme.fontUi
font.pixelSize: 10
}
@@ -137,7 +137,7 @@ Item {
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
- radius: Theme.radiusCard
+ radius: Theme.rCard
color: Theme.card
visible: root.tab === 1
@@ -148,13 +148,13 @@ Item {
Text {
text: "音频"
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
+ font.pixelSize: Theme.fsH3
}
RowLayout {
spacing: 10
- Text { text: "音量"; color: Theme.text2; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
+ Text { text: "音量"; color: Theme.t2; font.family: Theme.fontUi; font.pixelSize: Theme.fsSmall }
Slider {
implicitWidth: 200
from: 0; to: 1; value: veyra.volume
@@ -162,9 +162,9 @@ Item {
}
Text {
text: Math.round(veyra.volume * 100) + "%"
- color: Theme.text2
+ color: Theme.t2
font.family: Theme.fontMono
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
}
}
Switch {
@@ -174,7 +174,7 @@ Item {
}
RowLayout {
spacing: 10
- Text { text: "音频偏移"; color: Theme.text2; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
+ Text { text: "音频偏移"; color: Theme.t2; font.family: Theme.fontUi; font.pixelSize: Theme.fsSmall }
SpinBox {
from: -2000
to: 2000
@@ -182,23 +182,23 @@ Item {
value: veyra.audioOffsetMs
onValueModified: veyra.audioOffsetMs = value
}
- Text { text: "毫秒"; color: Theme.text3; font.family: Theme.fontUi; font.pixelSize: Theme.fontSizeSmall }
+ Text { text: "毫秒"; color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: Theme.fsSmall }
}
Rectangle { Layout.fillWidth: true; implicitHeight: 1; color: Theme.stroke }
Text {
text: "音轨"
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
+ font.pixelSize: Theme.fsH3
}
Text {
visible: veyra.audioTracks.length === 0
text: "当前源没有可选音轨。"
- color: Theme.text3
+ color: Theme.t3
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
}
Repeater {
model: veyra.audioTracks
@@ -214,14 +214,14 @@ Item {
spacing: 8
Rectangle {
width: 8; height: 8; radius: 4
- color: veyra.selectedAudioTrack === modelData.index ? Theme.accent : Theme.text3
+ color: veyra.selectedAudioTrack === modelData.index ? Theme.accent : Theme.t3
}
Text {
Layout.fillWidth: true
text: modelData.label
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ font.pixelSize: Theme.fsBody
}
}
HoverHandler { id: trackHover; cursorShape: Qt.PointingHandCursor }
@@ -237,7 +237,7 @@ Item {
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
- radius: Theme.radiusCard
+ radius: Theme.rCard
color: Theme.card
visible: root.tab === 2
@@ -248,9 +248,9 @@ Item {
Text {
text: "诊断"
- color: Theme.text1
+ color: Theme.t1
font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeTitle
+ font.pixelSize: Theme.fsH3
}
// Every line comes from the engine's own snapshot. Submit FPS is
// labelled as submit FPS: there is no display-FPS number here,
@@ -276,9 +276,9 @@ Item {
id: reportText
width: parent.width
text: veyra.diagnosticsReport()
- color: Theme.text2
+ color: Theme.t2
font.family: Theme.fontMono
- font.pixelSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fsSmall
wrapMode: Text.Wrap
}
}
diff --git a/qml/Veyra/Theme.qml b/qml/Veyra/Theme.qml
index 677d71a6..1cbb41c9 100644
--- a/qml/Veyra/Theme.qml
+++ b/qml/Veyra/Theme.qml
@@ -62,12 +62,12 @@ QtObject {
// --- type (--f-ui / --f-mono and the .h1/.h2/.h3 scale) ---------------
readonly property string fontUi: "Microsoft YaHei UI"
readonly property string fontMono: "Consolas"
- readonly property int fsEyebrow: 11
- readonly property int fsSmall: 11.5
- readonly property int fsBody: 12.5
- readonly property int fsH3: 15
- readonly property int fsH2: 18
- readonly property int fsH1: 26
+ readonly property real fsEyebrow: 11
+ readonly property real fsSmall: 11.5
+ readonly property real fsBody: 12.5
+ readonly property real fsH3: 15
+ readonly property real fsH2: 18
+ readonly property real fsH1: 26
// --- component metrics from the CSS -----------------------------------
readonly property int ctlHeight: 32 // .btn / .pill
diff --git a/qml/Veyra/TimingBar.qml b/qml/Veyra/TimingBar.qml
index af4cbb9e..214e1aa7 100644
--- a/qml/Veyra/TimingBar.qml
+++ b/qml/Veyra/TimingBar.qml
@@ -53,7 +53,7 @@ Item {
text: modelData.measured
? modelData.label + " " + modelData.ms.toFixed(1)
: modelData.label + " —"
- color: modelData.measured ? Theme.accentInk : Theme.text3
+ color: modelData.measured ? Theme.accentInk : Theme.t3
font.family: Theme.fontMono
font.pixelSize: 10
elide: Text.ElideRight
diff --git a/qml/Veyra/TopDock.qml b/qml/Veyra/TopDock.qml
index 52c73861..1e4e8f21 100644
--- a/qml/Veyra/TopDock.qml
+++ b/qml/Veyra/TopDock.qml
@@ -1,61 +1,47 @@
-// The top dock: hidden until the pointer reaches the top edge, then it drops in.
+// The top dock, rebuilt from the design (index.html .dock-zone/.dock/.dock-handle
+// and app.css's .dock* rules).
//
-// The user asked for this specifically (the old always-visible sidebar was too
-// large and crowded), so the hit zone is a thin strip at the very top and the
-// dock retracts on its own after a few idle seconds. It never covers the video
-// for longer than it takes to pick a page.
+// Design facts this follows:
+// * a 12px hit zone plus a 44x4 grab handle at the very top;
+// * the dock itself is a black pill, 40px tall buttons with SVG icons and a
+// tooltip; a separate indicator slides behind the selected button;
+// * it drops in from above and retracts 450ms after the pointer leaves;
+// * `dockPinned` keeps it open (the design uses that state for the 16:9 frame).
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Item {
id: dockRoot
- // Sits above the pages without stealing input from them.
- z: 30
+ z: 40
+ anchors.top: parent ? parent.top : undefined
width: parent ? parent.width : 0
- height: pointerZone.height + bar.height + 16
+ height: 12 + 46 + 20
required property string currentPage
signal requestPage(string page)
- // How long the dock stays out after the last interaction.
- readonly property int idleMs: 3200
property bool opened: false
- // Pinned open while a menu inside it is showing, so it cannot retract out
- // from under the user mid-click.
+ // Mirrors st.dockPinned in the design: pinned stays open regardless of hover.
property bool pinned: false
- // The strip that summons the dock. Thin, or it eats clicks meant for the
- // page underneath.
+ // --- page definitions (order and tooltips from core.js) ---------------
+ readonly property var items: [
+ { id: "min", icon: "🎬", tip: "极简" },
+ { id: "pro", icon: "⚙", tip: "专业模式" },
+ { id: "exp", icon: "⬇", tip: "导出" },
+ { id: "set", icon: "☰", tip: "设置" }
+ ]
+
+ // .dock-zone { height:12px } and .dock-handle { 44x4, top:5 }
Item {
- id: pointerZone
+ id: zone
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: 12
HoverHandler { onHoveredChanged: if (hovered) dockRoot.opened = true }
}
-
- Timer {
- id: retractTimer
- interval: dockRoot.idleMs
- onTriggered: if (!dockRoot.pinned) dockRoot.opened = false
- }
- onOpenedChanged: if (opened) retractTimer.restart()
-
- HoverHandler {
- onHoveredChanged: {
- if (hovered) {
- dockRoot.opened = true
- retractTimer.restart()
- } else {
- retractTimer.restart()
- }
- }
- }
-
- // The grab handle stays visible when the dock is away: without it there is
- // nothing to tell the user the dock exists.
Rectangle {
id: handle
anchors.horizontalCenter: parent.horizontalCenter
@@ -64,26 +50,43 @@ Item {
width: dockRoot.opened ? 18 : 44
height: 4
radius: 4
- color: Theme.text3
+ color: Qt.rgba(1, 1, 1, 0.28)
opacity: dockRoot.opened ? 0 : 1
- Behavior on width { NumberAnimation { duration: Theme.durationSlow; easing.bezierCurve: Theme.spring } }
- Behavior on opacity { NumberAnimation { duration: Theme.durationFast } }
+ Behavior on width { NumberAnimation { duration: 400; easing.bezierCurve: Theme.spring } }
+ Behavior on opacity { NumberAnimation { duration: 200 } }
+ HoverHandler { onHoveredChanged: if (hovered) dockRoot.opened = true }
}
+ // Retract 450ms after the pointer leaves, exactly like closeDock().
+ Timer {
+ id: retract
+ interval: 450
+ onTriggered: if (!dockRoot.pinned) dockRoot.opened = false
+ }
+ onOpenedChanged: if (!opened) ; else retract.stop()
+
+ // .dock: black pill, radius 999, 1px hairline, heavy drop shadow.
Rectangle {
id: bar
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
- anchors.topMargin: dockRoot.opened ? 8 : -bar.height - 8
- width: content.implicitWidth + 16
+ anchors.topMargin: dockRoot.opened ? 8 : -56
+ implicitWidth: content.implicitWidth + 20
height: 44
radius: height / 2
color: "#000000"
border.width: 1
- border.color: Theme.stroke2
- // The drop-in/retract spring is the whole feel of this control.
+ border.color: Qt.rgba(1, 1, 1, 0.1)
+ // .dock { transform: translate(-50%,-120%); transition: transform .55s spring }
Behavior on anchors.topMargin {
- NumberAnimation { duration: Theme.durationSlow; easing.bezierCurve: Theme.spring }
+ NumberAnimation { duration: 550; easing.bezierCurve: Theme.spring }
+ }
+
+ HoverHandler {
+ onHoveredChanged: {
+ if (hovered) { dockRoot.opened = true; retract.stop() }
+ else retract.restart()
+ }
}
RowLayout {
@@ -91,62 +94,83 @@ Item {
anchors.centerIn: parent
spacing: 2
- // The logo returns to the empty state, as asked. It is the only way
- // back to home from a zoomed-in page, so it is always available.
+ // .dock .logo: 40x30, returns to the empty state.
Item {
- width: 40
- height: 30
+ implicitWidth: 40
+ implicitHeight: 30
Rectangle {
anchors.fill: parent
radius: height / 2
- color: logoHover.hovered ? Theme.card2 : "transparent"
- enabled: false
- id: logoBg
+ color: logoHover.hovered ? "#1A1A1F" : "transparent"
}
- Text {
+ Image {
anchors.centerIn: parent
- text: "V"
- color: Theme.accent
- font.family: Theme.fontUi
- font.pixelSize: 18
- font.bold: true
+ source: "logo.png"
+ sourceSize.width: 26
+ fillMode: Image.PreserveAspectFit
}
HoverHandler { id: logoHover; cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: dockRoot.requestPage("home") }
+ TapHandler {
+ onTapped: dockRoot.requestPage("home")
+ onPressedChanged: if (pressed) scale = 0.9
+ }
}
- Repeater {
- model: [
- { id: "home", label: "主页" },
- { id: "minimal", label: "极简" },
- { id: "pro", label: "专业" },
- { id: "node", label: "节点" },
- { id: "export", label: "导出" },
- { id: "settings", label: "设置" }
- ]
- delegate: Item {
- required property var modelData
- implicitWidth: tabText.implicitWidth + 22
- implicitHeight: 30
- Rectangle {
- anchors.fill: parent
- radius: height / 2
- color: dockRoot.currentPage === modelData.id ? Theme.card3
- : tabHover.hovered ? Theme.card2 : "transparent"
- Behavior on color { ColorAnimation { duration: Theme.durationFast } }
+ // .dock-sep
+ Rectangle { implicitWidth: 1; implicitHeight: 16; color: Qt.rgba(1, 1, 1, 0.14) }
+
+ // .dock-items with the sliding .dock-ind behind the active button.
+ Item {
+ implicitWidth: itemsRow.implicitWidth
+ implicitHeight: 30
+ Rectangle {
+ id: indicator
+ width: 32
+ height: 30
+ radius: 999
+ color: "#26262D"
+ x: {
+ let idx = 0
+ for (let i = 0; i < dockRoot.items.length; ++i)
+ if (dockRoot.items[i].id === dockRoot.currentPage) idx = i
+ return idx * 34
}
- Text {
- id: tabText
- anchors.centerIn: parent
- text: modelData.label
- color: dockRoot.currentPage === modelData.id ? Theme.text1 : Theme.text2
- font.family: Theme.fontUi
- font.pixelSize: Theme.fontSizeBody
+ visible: dockRoot.currentPage !== "home"
+ // .dock-ind { transition: transform .55s var(--spring) }
+ Behavior on x { NumberAnimation { duration: 550; easing.bezierCurve: Theme.spring } }
+ }
+ Row {
+ id: itemsRow
+ spacing: 2
+ Repeater {
+ model: dockRoot.items
+ delegate: Item {
+ required property var modelData
+ width: 32
+ height: 30
+ Text {
+ anchors.centerIn: parent
+ text: modelData.icon
+ font.pixelSize: 15
+ opacity: dockRoot.currentPage === modelData.id ? 1.0 : 0.45
+ Behavior on opacity { NumberAnimation { duration: 200 } }
+ }
+ HoverHandler { cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: dockRoot.requestPage(modelData.id) }
+ }
}
- HoverHandler { id: tabHover; cursorShape: Qt.PointingHandCursor }
- TapHandler { onTapped: dockRoot.requestPage(modelData.id) }
}
}
+
+ Rectangle { implicitWidth: 1; implicitHeight: 16; color: Qt.rgba(1, 1, 1, 0.14) }
+
+ // .dock-live: the engine-running lamp. Lit only when the engine really
+ // reports running; no decorative lamp.
+ Item {
+ implicitWidth: 19
+ implicitHeight: 30
+ VDot { anchors.centerIn: parent; off: !veyra.running; warn: veyra.captureRecovering }
+ }
}
}
}
diff --git a/qml/Veyra/logo.png b/qml/Veyra/logo.png
new file mode 100644
index 00000000..f7378b8d
Binary files /dev/null and b/qml/Veyra/logo.png differ
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index 4cbbbce5..c92b70dc 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -106,6 +106,197 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
QmlPlayerBridge::~QmlPlayerBridge() = default;
+
+// --- professional-page readouts ---------------------------------------------
+// These read fields the engine genuinely publishes. Where it publishes nothing,
+// the getter says so and the UI shows an explicit "unmeasured" rather than a
+// zero or a stand-in.
+QString QmlPlayerBridge::outputSummary() const {
+ // The engine publishes the source extent and the preview scale, not the final
+ // working extent, so the honest answer is the source size at the reported
+ // scale factor. Nothing here invents a resolution the graph did not produce.
+ const auto& s = impl_->snapshot;
+ if (s.sourceWidth == 0 || s.sourceHeight == 0) return {};
+ return QStringLiteral("%1x%2").arg(s.sourceWidth).arg(s.sourceHeight);
+}
+
+// A display rate is only real when the system's display event can be read. No
+// counter is wired in this build, so it reports unknown and the UI shows "未测" -
+// which is exactly what the design requires instead of passing the submit rate off
+// as a measurement that was never taken.
+double QmlPlayerBridge::displayFps() const { return 0.0; }
+bool QmlPlayerBridge::displayFpsKnown() const { return false; }
+
+double QmlPlayerBridge::queuedFrames() const {
+ // Preview frames the scheduler chose not to present, as a running count. This
+ // is in-process scheduling, NOT screen latency, and the UI labels it so.
+ return double(impl_->snapshot.previewSkipped);
+}
+
+int QmlPlayerBridge::skippedFrames() const { return int(impl_->snapshot.previewSkipped); }
+
+QString QmlPlayerBridge::flowBackend() const {
+ // The snapshot carries a performance figure and a content rate, not a backend
+ // name; report the fact we do have and let it read as unmeasured otherwise.
+ const auto& s = impl_->snapshot;
+ if (s.flowPerf == 0) return {};
+ return QStringLiteral("GPU 光流");
+}
+
+QVariantList QmlPlayerBridge::stageTimings() const {
+ // The engine publishes CPU-side percentiles per phase, not per-GPU-stage
+ // timings, so the three signals it does publish are what is shown. A stage
+ // with no sample reports as unmeasured instead of a zero-length bar.
+ const auto& s = impl_->snapshot;
+ QVariantList out;
+ struct Row { const char* label; double ms; const char* color; bool measured; };
+ const Row rows[] = {
+ {"调度", s.schedulingWaitP95Ms, "#6EA8FF", s.schedulingWaitP95Ms > 0.0},
+ {"处理", s.processCpuP95Ms, "#FF8A3D", s.processCpuP95Ms > 0.0},
+ {"呈现", s.presentCpuP95Ms, "#3DDC84", s.presentCpuP95Ms > 0.0},
+ };
+ const double budget = stageBudgetMs();
+ for (const auto& r : rows) {
+ QVariantMap item;
+ item["label"] = QString::fromUtf8(r.label);
+ item["ms"] = r.ms;
+ item["measured"] = r.measured;
+ item["color"] = QString::fromUtf8(r.color);
+ item["fraction"] = (r.measured && budget > 0.01) ? r.ms / budget : 0.0;
+ out << item;
+ }
+ return out;
+}
+
+double QmlPlayerBridge::stageBudgetMs() const {
+ // One source period: the budget a stage has to stay inside. Zero when the
+ // source rate is unknown, which the UI shows as unmeasured.
+ const double fps = impl_->snapshot.nominalSourceFps;
+ return fps > 0.01 ? 1000.0 / fps : 0.0;
+}
+
+double QmlPlayerBridge::scheduleP95Ms() const { return impl_->snapshot.schedulingWaitP95Ms; }
+
+double QmlPlayerBridge::chainTotalMs() const {
+ // Sum of the phases the engine measured. Zero means nothing measured yet, and
+ // the UI shows "未测" rather than a zero that would read as instant.
+ const auto& s = impl_->snapshot;
+ const double total = s.schedulingWaitP95Ms + s.processCpuP95Ms + s.presentCpuP95Ms;
+ return total > 0.0 ? total : 0.0;
+}
+
+
+// --- frame generation --------------------------------------------------------
+QString QmlPlayerBridge::fgBackendName() const {
+ return impl_->facade.pendingSettings().frameGenerationBackend
+ == engine::FrameGenerationBackend::XeSS
+ ? QStringLiteral("xess") : QStringLiteral("dlss");
+}
+void QmlPlayerBridge::setFgBackendName(const QString& value) {
+ auto s = settings();
+ const auto want = value == QLatin1String("xess") ? engine::FrameGenerationBackend::XeSS
+ : engine::FrameGenerationBackend::Dlss;
+ if (s.frameGenerationBackend == want) return;
+ s.frameGenerationBackend = want;
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+
+int QmlPlayerBridge::fgMaxMultiplier() const {
+ // Start from 2, the multiplier every path supports, and raise it only on a
+ // capability the engine actually reported.
+ const auto& s = impl_->snapshot;
+ int best = 2;
+ if (s.fgCapabilityKnown) best = std::max(best, s.fgMultiFrameMax);
+ if (s.xessMaxInterpolatedFrames > 0) best = std::max(best, s.xessMaxInterpolatedFrames + 1);
+ if (s.fsrMaxGeneratedFrames > 0) best = std::max(best, s.fsrMaxGeneratedFrames + 1);
+ return std::min(best, 6);
+}
+
+QVariantList QmlPlayerBridge::fgMultiplierChoices() const {
+ // Only multipliers the chosen backend supports are offered: DLSS reaches 6X on
+ // capable hardware, XeSS stops at 4X. Offering a value the provider would
+ // refuse is the same lie as a dead control.
+ const bool xess = impl_->facade.pendingSettings().frameGenerationBackend
+ == engine::FrameGenerationBackend::XeSS;
+ const int ceiling = xess ? std::min(fgMaxMultiplier(), 4) : fgMaxMultiplier();
+ QVariantList out;
+ for (int m = 2; m <= ceiling; ++m) {
+ QVariantMap item;
+ item["id"] = QString::number(m);
+ item["label"] = QString::number(m) + QStringLiteral("X");
+ out << item;
+ }
+ return out;
+}
+
+bool QmlPlayerBridge::fgStrict() const { return impl_->facade.pendingSettings().fgStrictAdmission; }
+void QmlPlayerBridge::setFgStrict(bool value) {
+ auto s = settings();
+ if (s.fgStrictAdmission == value) return;
+ s.fgStrictAdmission = value;
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+
+bool QmlPlayerBridge::fgLowQueue() const { return impl_->facade.pendingSettings().lowLatency; }
+void QmlPlayerBridge::setFgLowQueue(bool value) {
+ auto s = settings();
+ if (s.lowLatency == value) return;
+ s.lowLatency = value;
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+
+// --- colour ------------------------------------------------------------------
+double QmlPlayerBridge::colorExposure() const { return settings().color.exposure; }
+void QmlPlayerBridge::setColorExposure(double v) {
+ auto s = settings();
+ if (double(s.color.exposure) == v) return;
+ s.color.exposure = float(v);
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+double QmlPlayerBridge::colorContrast() const { return settings().color.contrast; }
+void QmlPlayerBridge::setColorContrast(double v) {
+ auto s = settings();
+ if (double(s.color.contrast) == v) return;
+ s.color.contrast = float(v);
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+double QmlPlayerBridge::colorSaturation() const { return settings().color.saturation; }
+void QmlPlayerBridge::setColorSaturation(double v) {
+ auto s = settings();
+ if (double(s.color.saturation) == v) return;
+ s.color.saturation = float(v);
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+double QmlPlayerBridge::colorTemperature() const { return settings().color.temperature; }
+void QmlPlayerBridge::setColorTemperature(double v) {
+ auto s = settings();
+ if (double(s.color.temperature) == v) return;
+ s.color.temperature = float(v);
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+
+void QmlPlayerBridge::resetCurrentPage() {
+ // Reset only the enhancement settings this page edits. Presets, recent files,
+ // the capture session and the export selection are deliberately untouched.
+ auto s = settings();
+ s.nr = false; s.sr = false; s.multiplier = 1;
+ s.lowLatency = false; s.nrTemporal = false;
+ s.model = engine::NrSettings{};
+ s.residual = engine::ResidualSettings{};
+ s.protection = engine::ProtectionSettings{};
+ s.color = engine::ColorSettings{};
+ s.videoHdr = engine::VideoHdrSettings{};
+ impl_->commit(std::move(s));
+ emit settingsChanged();
+}
+
void QmlPlayerBridge::attachVideoWindow(qulonglong nativeHandle) {
impl_->videoWindow = reinterpret_cast<HWND>(nativeHandle);
}
@@ -149,6 +340,16 @@ int QmlPlayerBridge::sourceWidth() const { return int(impl_->snapshot.sourceWidt
int QmlPlayerBridge::sourceHeight() const { return int(impl_->snapshot.sourceHeight); }
double QmlPlayerBridge::sourceFps() const { return impl_->snapshot.nominalSourceFps; }
int QmlPlayerBridge::sourceRotation() const { return impl_->snapshot.sourceRotationDegrees; }
+double QmlPlayerBridge::sourceAspect() const {
+ const auto& s = impl_->snapshot;
+ // The container's display aspect already accounts for sample aspect ratio and
+ // rotation, so prefer it. The pixel ratio is only a fallback for a source that
+ // reported none, and it is never presented as more than that.
+ if (s.sourceDisplayAspect > 0.01) return s.sourceDisplayAspect;
+ if (s.sourceWidth > 0 && s.sourceHeight > 0)
+ return double(s.sourceWidth) / double(s.sourceHeight);
+ return 0.0;
+}
// --- live performance -------------------------------------------------------
double QmlPlayerBridge::submitFps() const { return impl_->snapshot.submissionFps.value_or(0.0); }
@@ -337,6 +538,16 @@ QVariantList QmlPlayerBridge::presets() const {
return out;
}
+QString QmlPlayerBridge::currentPresetName() const {
+ // Matching is by name of the stored entry whose chain equals what the UI is
+ // showing; anything else is honestly "自定义" rather than the nearest guess.
+ const auto& entries = impl_->facade.presets().entries();
+ for (const auto& e : entries) {
+ if (e.chain == impl_->chain) return utf8Of(e.name);
+ }
+ return tr("自定义");
+}
+
QVariantList QmlPlayerBridge::audioTracks() const {
QVariantList out;
for (const auto& track : impl_->snapshot.audioTracks) {
@@ -358,6 +569,26 @@ int QmlPlayerBridge::selectedAudioTrack() const { return impl_->snapshot.selecte
void QmlPlayerBridge::setSelectedAudioTrack(int index) {
impl_->engine.selectAudioTrack(impl_->snapshot.sessionId, index);
}
+bool QmlPlayerBridge::hasCaptureSession() const { return impl_->facade.hasCaptureSession(); }
+
+QString QmlPlayerBridge::captureSessionSummary() const {
+ // Built from the recorded session only: the device, the format and the preset
+ // that were actually used. A summary assembled from defaults would read as a
+ // history that never happened.
+ const auto& session = impl_->facade.lastCaptureSession();
+ QStringList parts;
+ if (!session.devicePath.empty()) parts << QFileInfo(utf8Of(session.devicePath)).fileName();
+ if (!session.formatKey.empty()) parts << utf8Of(session.formatKey);
+ if (session.fps > 0.01) parts << QStringLiteral("%1 fps").arg(session.fps, 0, 'f', 2);
+ if (!session.presetName.empty()) parts << tr("预设「%1」").arg(utf8Of(session.presetName));
+ return parts.join(QStringLiteral(" · "));
+}
+
+void QmlPlayerBridge::resumeCaptureSession() {
+ const auto& session = impl_->facade.lastCaptureSession();
+ if (!session.devicePath.empty()) emit notice(tr("采集会话恢复尚未接入"), true);
+}
+
QString QmlPlayerBridge::colorStatus() const { return utf8Of(impl_->snapshot.colorStatus); }
QString QmlPlayerBridge::videoHdrStatus() const { return utf8Of(impl_->snapshot.videoHdrStatus); }