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): page top strips move the window, launch on the pointer's monitor, slider arrow keys, pro subtitle/audio menus, hideable cinema pill, capture audio remembered on pick

Veyra Goal Agentf730ba68caec
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index b138127a..0a057f14 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -579,6 +579,11 @@ public:
QVariantMap preferences() const;
Q_INVOKABLE void rememberWindowSize(int width, int height);
Q_INVOKABLE bool setPreference(const QString& key, const QVariant& value);
+ // Available area (taskbar excluded) of the screen holding a point, or of the screen the
+ // pointer is on at start. QML's Screen.desktopAvailable* span the whole virtual desktop,
+ // which centred the window across two of three monitors (field report 2026-10-01).
+ Q_INVOKABLE QRect screenAvailableAt(int x, int y) const;
+ Q_INVOKABLE QRect launchScreenAvailable() const;
QString screenshotDirectory() const;
QString lastScreenshot() const;
QString dataDirectory() const;
diff --git a/qml/Veyra/CineBar.qml b/qml/Veyra/CineBar.qml
index 31fde799..6e5a5bf0 100644
--- a/qml/Veyra/CineBar.qml
+++ b/qml/Veyra/CineBar.qml
@@ -19,6 +19,7 @@ Rectangle {
signal requestLock()
// Windowed 极简: a drag on the pill's empty space moves the window, like a title bar.
signal requestMove()
+ signal requestHide()
// Set on the fullscreen bar: shows the lock button.
property bool fullscreen: false
// Set by FullscreenBar so upward menus stop above the playback pill.
@@ -350,7 +351,7 @@ Rectangle {
// --- right: preset, volume, fullscreen (230px) ---------------
RowLayout {
- Layout.preferredWidth: 230; Layout.minimumWidth: 230; Layout.maximumWidth: 230
+ Layout.preferredWidth: 250; Layout.minimumWidth: 250; Layout.maximumWidth: 250
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
spacing: 6
@@ -367,7 +368,7 @@ Rectangle {
}
Item {
- implicitWidth: 92
+ implicitWidth: 80
implicitHeight: 20
RowLayout {
anchors.fill: parent
@@ -393,6 +394,17 @@ Rectangle {
// undefined root.requestPage("pro").
TapHandler { onTapped: bar.requestFullscreen() }
}
+ // Hide the pill (field request 2026-10-01: it covers the game when playing
+ // through a capture card or a stream). The dock's eye button brings it back.
+ Item {
+ objectName: "cine-hide"
+ implicitWidth: 32; implicitHeight: 32
+ VIcon { anchors.centerIn: parent; name: "eyeoff"; color: hideHover.hovered ? "#FFFFFF" : Theme.t2 }
+ HoverHandler { id: hideHover; cursorShape: Qt.PointingHandCursor }
+ ToolTip.visible: hideHover.hovered
+ ToolTip.text: "隐藏播放条(顶部胶囊里可重新打开)"
+ TapHandler { onTapped: bar.requestHide() }
+ }
}
}
diff --git a/qml/Veyra/FullscreenBar.qml b/qml/Veyra/FullscreenBar.qml
index 7052b00b..287b2440 100644
--- a/qml/Veyra/FullscreenBar.qml
+++ b/qml/Veyra/FullscreenBar.qml
@@ -23,6 +23,7 @@ Window {
signal requestFullscreen()
signal requestLock()
signal requestMove()
+ signal requestHide()
// Pointer movement over the bar keeps the controls up (the main window cannot
// see it here).
signal activity()
@@ -109,6 +110,7 @@ Window {
onRequestFullscreen: win.requestFullscreen()
onRequestLock: win.requestLock()
onRequestMove: win.requestMove()
+ onRequestHide: win.requestHide()
HoverHandler {
// Real movement only: hover repeats while the bar animates.
property point last: Qt.point(-1, -1)
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index f886d9df..6a80035b 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -67,10 +67,10 @@ Window {
// The tallest picture that still fits on the screen with the pill (46px) under
// it. A portrait video or a captured portrait window used to make the window
// taller than the screen (field report 2026-10-01).
- readonly property real maxPictureHeight: {
- const s = root.screen
- return s ? Math.max(200, Math.min(s.height, s.desktopAvailableHeight) - 46 - 16) : 100000
- }
+ // The screen under the window's top centre (Screen.desktopAvailable* is the whole
+ // virtual desktop, wrong on multi-monitor setups).
+ readonly property rect screenArea: veyra.screenAvailableAt(root.x + root.width / 2, root.y + 20)
+ readonly property real maxPictureHeight: Math.max(200, root.screenArea.height - 46 - 16)
readonly property real pictureHeight: Math.min(Math.round(width / filmAspect), maxPictureHeight)
// The width a tall film took away, given back when a wider film fits again.
property real widthBeforeNarrow: 0
@@ -94,10 +94,9 @@ Window {
}
// The pill hangs 46px below the picture: lift the window if that leaves the screen.
function keepPillOnScreen() {
- const s = root.screen
- if (!s) return
- const bottom = s.virtualY + Math.min(s.height, s.desktopAvailableHeight)
- if (y + pictureHeight + 46 + 8 > bottom) y = Math.max(s.virtualY, bottom - pictureHeight - 46 - 8)
+ const a = root.screenArea
+ const bottom = a.y + a.height
+ if (y + pictureHeight + 46 + 8 > bottom) y = Math.max(a.y, bottom - pictureHeight - 46 - 8)
}
// .vy.cine transition: height .7s var(--spring-soft)
Behavior on height {
@@ -251,6 +250,7 @@ Window {
MinimalPage {
id: minPage
pageId: "min"
+ dragStripHeight: 0
home: pages
onRequestPage: p => root.goPage(p)
onRequestAspect: aspect => { if (root.testAspect <= 0) root.fitToFilm(aspect) }
@@ -268,6 +268,7 @@ Window {
NodePage {
id: nodePage
pageId: "node"
+ dragStripHeight: 14
home: pages
videoHeight: root.nodeVideoHeight
onVideoHeightEdited: h => { root.nodeVideoHeight = h; videoHost.syncRect() }
@@ -319,6 +320,9 @@ Window {
onRequestMaximize: root.toggleMaximized()
onRequestClose: root.close()
onRequestMove: if (!root.fullscreen) root.startSystemMove()
+ pillToggleVisible: veyra.hasSource && (root.page === "min" || root.fullscreen)
+ pillHidden: root.pillHidden
+ onRequestTogglePill: root.setPillHidden(!root.pillHidden)
}
// Frameless window: the system resizes from 6px borders and 12px corners.
@@ -490,7 +494,7 @@ Window {
// an open dialog, which lives in the main window below it.
cinema: root.cinema && !root.fullscreen
pillTop: (root.maximized ? root.height : root.pictureHeight) - 46
- shown: veyra.hasSource && (root.fullscreen ? root.fullControls && !root.fullLocked
+ shown: veyra.hasSource && !root.pillHidden && (root.fullscreen ? root.fullControls && !root.fullLocked
: root.cinema && root.shownPage === "min"
&& root.leavingPage === "" && dialogs.dialog === ""
&& root.visibility !== Window.Minimized)
@@ -498,9 +502,17 @@ Window {
onRequestDialog: k => dialogs.open(k)
onRequestFullscreen: root.toggleFullscreen()
onRequestLock: root.toggleLock()
+ onRequestHide: root.setPillHidden(true)
onRequestMove: if (!root.fullscreen && !root.maximized) root.startSystemMove()
onActivity: root.pointerActivity()
}
+ // The cinema / fullscreen pill can be hidden for games (capture card, streams); the
+ // dock's eye brings it back. Remembered across sessions.
+ readonly property bool pillHidden: veyra.preferences.cinePillHidden === true
+ function setPillHidden(hidden) {
+ veyra.setPreference("cinePillHidden", hidden)
+ toast.show(hidden ? "播放条已隐藏 · 鼠标移到顶部,点胶囊里的眼睛可重新打开" : "播放条已显示", false)
+ }
function toggleLock() {
fullLocked = !fullLocked
if (fullLocked) dock.opened = false
@@ -684,14 +696,13 @@ Window {
const text = choice === "last" ? (veyra.preferences.lastWindow || "1280x800") : choice
const wh = text.split("x").map(Number)
if (wh.length !== 2 || !(wh[0] > 0) || !(wh[1] > 0)) return
- const sw = root.screen ? root.screen.desktopAvailableWidth : wh[0]
- const sh = root.screen ? root.screen.desktopAvailableHeight : wh[1]
- root.width = Math.max(root.minimumWidth, Math.min(wh[0], sw - 40))
- root.height = Math.max(root.minimumHeight, Math.min(wh[1], sh - 40))
- if (root.screen) {
- root.x = root.screen.virtualX + Math.round((sw - root.width) / 2)
- root.y = root.screen.virtualY + Math.round((sh - root.height) / 2)
- }
+ // Centred on the monitor the pointer is on when Veyra starts (the one it was
+ // launched from), not across the whole desktop.
+ const a = veyra.launchScreenAvailable()
+ root.width = Math.max(root.minimumWidth, Math.min(wh[0], a.width - 40))
+ root.height = Math.max(root.minimumHeight, Math.min(wh[1], a.height - 40))
+ root.x = a.x + Math.round((a.width - root.width) / 2)
+ root.y = a.y + Math.round((a.height - root.height) / 2)
}
onClosing: if (!root.fullscreen && !root.maximized && !root.cinema) veyra.rememberWindowSize(root.width, root.height)
Component.onCompleted: {
diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qml
index 32263fba..7fc6817b 100644
--- a/qml/Veyra/ProPage.qml
+++ b/qml/Veyra/ProPage.qml
@@ -590,6 +590,36 @@ VPage {
kind: veyra.fgEnabled ? "acc" : ""
text: veyra.fgEnabled ? veyra.fgMultiplier + "X" : "补帧关"
}
+ // Subtitle and audio-track menus (field request 2026-10-01), the same menus as the
+ // 极简 pill's, beside the fullscreen button.
+ component BarButton: Item {
+ id: barBtn
+ property string glyph: ""
+ property string tip: ""
+ signal tapped()
+ implicitWidth: 28; implicitHeight: 28
+ VIcon { anchors.centerIn: parent; name: barBtn.glyph; color: barHover.hovered ? Theme.t1 : Theme.t2 }
+ HoverHandler { id: barHover; cursorShape: Qt.PointingHandCursor }
+ TapHandler { onTapped: barBtn.tapped() }
+ ToolTip.visible: barHover.hovered
+ ToolTip.text: barBtn.tip
+ }
+ BarButton {
+ id: proCcButton
+ objectName: "pro-subtitles"
+ glyph: "cc"
+ tip: "字幕"
+ visible: veyra.hasSource && !veyra.isCapture
+ onTapped: proCcMenu.openAt(proCcButton, "up")
+ }
+ BarButton {
+ id: proAudioButton
+ objectName: "pro-audio-tracks"
+ glyph: "music"
+ tip: "音轨"
+ visible: veyra.hasSource && !veyra.isCapture
+ onTapped: proAudioMenu.openAt(proAudioButton, "up")
+ }
// Fullscreen, at the picture's bottom-right corner where players put it.
Item {
objectName: "pro-fullscreen"
@@ -1738,6 +1768,37 @@ VPage {
}
readonly property real testMenuScale: sourceMenu.motionScale
+ // The pill's 字幕 / 音轨 menus, for the video bar's buttons.
+ VMenu {
+ id: proCcMenu
+ title: "字幕"
+ items: [{ label: "关闭", checked: veyra.subtitlePrimary < 0, track: -1 }]
+ .concat(veyra.subtitleTracks.map(t => ({ label: t.label, note: t.note, track: t.index,
+ disabled: !t.usable, checked: t.index === veyra.subtitlePrimary })))
+ .concat([{ label: "加载外部字幕…", icon: "import", act: "load" },
+ { sep: true },
+ { label: "字幕设置…", note: "字体、字号、描边、位置、延时", icon: "type", act: "dlg" }])
+ onPicked: (i, o) => {
+ if (o.act === "load") veyra.loadSubtitleDialog()
+ else if (o.act === "dlg") root.requestDialog("subtitle")
+ else if (o.track !== undefined) veyra.subtitlePrimary = o.track
+ }
+ }
+ VMenu {
+ id: proAudioMenu
+ title: "音轨"
+ readonly property var mk: t => ({ label: t.label, index: t.index,
+ note: t.channels > 0 ? (t.channels + " 声道") : "",
+ checked: t.index === veyra.selectedAudioTrack })
+ items: veyra.audioTracks.length > 0
+ ? veyra.audioTracks.map(mk).concat([{ sep: true },
+ { label: "音频设置…", note: "输出设备、音画同步、偏移", icon: "music", act: "dlg" }])
+ : [{ label: "片源没有音轨或尚未打开", disabled: true }]
+ onPicked: (i, o) => {
+ if (o.act === "dlg") return root.requestDialog("audio")
+ if (o.index !== undefined) veyra.selectedAudioTrack = o.index
+ }
+ }
// pages-pro.js data-srcbtn: the open source first (checked), then the ways in.
VMenu {
id: sourceMenu
diff --git a/qml/Veyra/SettingsPage.qml b/qml/Veyra/SettingsPage.qml
index 63f72785..bac8b8e4 100644
--- a/qml/Veyra/SettingsPage.qml
+++ b/qml/Veyra/SettingsPage.qml
@@ -197,6 +197,16 @@ VPage {
onToggled: checked => veyra.reducedMotion = checked
}
}
+ VRow {
+ label: "滑块键盘微调"
+ hint: "点一下滑块后用 ← → 调整,每次的幅度;Esc 交还方向键给快进快退"
+ VSeg {
+ objectName: "set-slider-step"
+ options: [{ id: "1", label: "1" }, { id: "0.1", label: "0.1" }, { id: "0.01", label: "0.01" }]
+ current: String(veyra.preferences.sliderKeyStep !== undefined ? veyra.preferences.sliderKeyStep : 0.1)
+ onPicked: id => veyra.setPreference("sliderKeyStep", Number(id))
+ }
+ }
VRow {
label: "背景渐变强度"
hint: "深黑底上的极轻渐变与抖动(防色带)"
diff --git a/qml/Veyra/TopDock.qml b/qml/Veyra/TopDock.qml
index f6ac8e96..a0f0c452 100644
--- a/qml/Veyra/TopDock.qml
+++ b/qml/Veyra/TopDock.qml
@@ -26,6 +26,10 @@ Item {
signal requestMaximize()
signal requestClose()
signal requestMove()
+ // The cinema pill's eye: shown on 极简 and in fullscreen, toggles the pill.
+ property bool pillToggleVisible: false
+ property bool pillHidden: false
+ signal requestTogglePill()
property bool opened: false
// Mirrors st.dockPinned in the design: pinned stays open regardless of hover.
@@ -236,6 +240,48 @@ Item {
Rectangle { implicitWidth: 1; implicitHeight: 16; color: Qt.rgba(1, 1, 1, 0.14) }
+ // Show / hide the cinema pill (field request 2026-10-01). Only where the pill lives.
+ Item {
+ objectName: "dock-pill-toggle"
+ visible: dockRoot.pillToggleVisible
+ implicitWidth: visible ? 32 : 0
+ implicitHeight: 30
+ scale: pillTap.pressed ? 0.86 : 1
+ Behavior on scale { NumberAnimation { duration: Theme.d(450); easing.bezierCurve: Theme.spring } }
+ VIcon {
+ anchors.centerIn: parent
+ name: dockRoot.pillHidden ? "eye" : "eyeoff"
+ color: "#FFFFFF"
+ opacity: pillHover.hovered ? 1.0 : 0.45
+ }
+ Rectangle {
+ objectName: "videoCover"
+ property real coverRadius: 7
+ readonly property bool on: pillHover.hovered
+ x: (parent.width - width) / 2
+ y: 38
+ width: pillTipText.implicitWidth + 18
+ height: pillTipText.implicitHeight + 10
+ radius: 7
+ color: Theme.popover
+ border.width: 1
+ border.color: Theme.stroke2
+ opacity: on ? 1 : 0
+ visible: opacity > 0
+ Behavior on opacity { NumberAnimation { duration: Theme.d(150) } }
+ Text {
+ id: pillTipText
+ anchors.centerIn: parent
+ text: dockRoot.pillHidden ? "显示播放条" : "隐藏播放条"
+ color: "#FFFFFF"
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ }
+ }
+ HoverHandler { id: pillHover; cursorShape: Qt.PointingHandCursor }
+ TapHandler { id: pillTap; onTapped: dockRoot.requestTogglePill() }
+ }
+
// .dock-live: the engine-running lamp. Lit only when the engine really
// reports running; no decorative lamp.
Item {
diff --git a/qml/Veyra/VPage.qml b/qml/Veyra/VPage.qml
index dff737ee..8f410a90 100644
--- a/qml/Veyra/VPage.qml
+++ b/qml/Veyra/VPage.qml
@@ -22,6 +22,28 @@ Item {
width: home ? home.width : 0
height: home ? home.height : 0
visible: current || leaving
+ // Title-bar behaviour on the page's top strip (field request 2026-10-01: only the
+ // dock capsule moved the window). Below the page's own items, so buttons and fields
+ // there keep their clicks; empty space drags, a double click maximizes. Pages whose
+ // top is the picture set a smaller strip (node) or none (min).
+ property real dragStripHeight: 56
+ Item {
+ objectName: "page-drag-strip"
+ z: -1
+ x: 0; y: 0
+ width: page.width
+ height: page.dragStripHeight
+ visible: height > 0
+ DragHandler {
+ target: null
+ enabled: page.shell !== null && !page.shell.fullscreen && !page.shell.maximized
+ onActiveChanged: if (active) page.shell.startSystemMove()
+ }
+ TapHandler {
+ enabled: page.shell !== null && !page.shell.fullscreen
+ onDoubleTapped: page.shell.toggleMaximized()
+ }
+ }
enabled: current
opacity: leaving ? 1 - shell.leaveT : 1
scale: leaving ? 1 - 0.015 * shell.leaveT : 1
diff --git a/qml/Veyra/VSlider.qml b/qml/Veyra/VSlider.qml
index 1838f903..bdc9216f 100644
--- a/qml/Veyra/VSlider.qml
+++ b/qml/Veyra/VSlider.qml
@@ -34,6 +34,28 @@ Item {
moved(amount)
}
+ // Keyboard (field request 2026-10-01): a clicked or dragged slider takes focus and the
+ // arrow keys move it by the 设置 step (1 / 0.1 / 0.01), at least a thousandth of the
+ // range so wide ranges still move. While focused the arrows belong to the slider, not
+ // to the window's seek and volume shortcuts; Esc gives them back.
+ activeFocusOnTab: enabledControl
+ readonly property real keyStep: Math.max(Number(typeof veyra !== "undefined" && veyra.preferences ? (veyra.preferences.sliderKeyStep || 0.1) : 0.1), (to - from) / 1000)
+ function nudge(direction) {
+ const next = Math.max(from, Math.min(to, value + direction * keyStep))
+ // Snap to the step grid so 0.1 steps do not drift into 0.30000000000000004.
+ commitValue(Math.round(next / keyStep) * keyStep)
+ }
+ Keys.onShortcutOverride: event => {
+ if (event.key === Qt.Key_Left || event.key === Qt.Key_Right || event.key === Qt.Key_Up
+ || event.key === Qt.Key_Down || event.key === Qt.Key_Escape) event.accepted = true
+ }
+ Keys.onPressed: event => {
+ if (!enabledControl) return
+ if (event.key === Qt.Key_Left || event.key === Qt.Key_Down) { nudge(-1); event.accepted = true }
+ else if (event.key === Qt.Key_Right || event.key === Qt.Key_Up) { nudge(1); event.accepted = true }
+ else if (event.key === Qt.Key_Escape) { focus = false; event.accepted = true }
+ }
+
implicitHeight: 20
implicitWidth: 160
readonly property real displayedValue: valueFromModel && drag.active ? dragValue : value
@@ -68,6 +90,8 @@ Item {
anchors.verticalCenter: track.verticalCenter
x: track.width * slider.frac - width / 2
scale: drag.active || hover.hovered ? 1.25 : 1.0
+ border.width: slider.activeFocus ? 2 : 0
+ border.color: Theme.accent
Behavior on scale { NumberAnimation { duration: Theme.d(350); easing.bezierCurve: Theme.spring } }
}
// box-shadow: 0 2px 6px rgba(0,0,0,.5). A sibling MultiEffect, not layer.effect: Qt recreates a layer's effect item on
@@ -104,6 +128,7 @@ Item {
}
onActiveChanged: {
if (active) {
+ slider.forceActiveFocus()
slider.dragValue = slider.value
startX = track.width * slider.frac
} else { liveTimer.stop(); slider.commitValue(slider.valueFromModel ? slider.dragValue : slider.value) }
@@ -115,6 +140,7 @@ Item {
// activating an inspector button on a card underneath this slider.
gesturePolicy: TapHandler.WithinBounds
onTapped: point => {
+ slider.forceActiveFocus()
const x = Math.max(0, Math.min(track.width, point.position.x))
slider.commitValue(slider.from + (x / track.width) * (slider.to - slider.from))
}
diff --git a/scripts/ui-check/capture-audio-remember.qml b/scripts/ui-check/capture-audio-remember.qml
new file mode 100644
index 00000000..c5f2818b
--- /dev/null
+++ b/scripts/ui-check/capture-audio-remember.qml
@@ -0,0 +1,23 @@
+
+ // ---- capture audio choice survives a restart (run twice with the same out dir) ---------
+ // MODE=pick: choose the first WASAPI input and connect. MODE=check: report the choice.
+ Timer { interval: 150; running: true; repeat: true; onTriggered: veyra.logUi("uitest-tick", "") }
+ Timer {
+ interval: 1000; running: true; repeat: true
+ property int ticks: 0
+ onTriggered: {
+ ++ticks
+ if (ticks === 2) dialogs.open("capture")
+ if (ticks === 5) {
+ const inputs = veyra.captureAudioInputs
+ veyra.logUi("uitest", "UITEST_NOTE choice=" + veyra.captureAudioChoice + " inputs=" + inputs.map(i => i.id + ":" + i.label).join(" | "))
+ if ("@MODE@" === "pick") {
+ const w = inputs.find(i => i.label.indexOf("[WASAPI]") === 0)
+ if (w) veyra.captureAudioChoice = w.id
+ veyra.logUi("uitest", "UITEST_NOTE picked=" + veyra.captureAudioChoice)
+ veyra.startCaptureSession(); dialogs.close()
+ }
+ }
+ if (ticks === 9) { veyra.logUi("uitest", "UITEST_DONE"); running = false }
+ }
+ }
diff --git a/scripts/ui-check/ui-batch-3.qml b/scripts/ui-check/ui-batch-3.qml
new file mode 100644
index 00000000..76367f60
--- /dev/null
+++ b/scripts/ui-check/ui-batch-3.qml
@@ -0,0 +1,94 @@
+
+ // ---- field requests 2026-10-01 (third batch): page drag strip, slider arrow keys, ---------
+ // pro subtitle/audio buttons, hiding the cinema pill. Needs --page pro and VIDEO.
+ property var uiStart: ({})
+ property var uiSlider: null
+ function uiLog(m) { veyra.logUi("uitest", m) }
+ function uiFail(m) { uiRun.failed = true; uiLog("UITEST_FAIL " + m) }
+ function uiFind(item, test, out) {
+ if (test(item)) out.push(item)
+ for (const c of item.children) uiFind(c, test, out)
+ return out
+ }
+ Timer { interval: 150; running: true; repeat: true; onTriggered: veyra.logUi("uitest-tick", "") }
+ onXChanged: veyra.logUi("uitest", "win x=" + x)
+ onYChanged: veyra.logUi("uitest", "win y=" + y)
+ readonly property var uiSteps: [
+ [1500, () => veyra.openUrl("@VIDEO@")],
+ [3000, () => {
+ if (root.page !== "pro") return uiFail("start page " + root.page)
+ const a = root.screenArea
+ uiLog("UITEST_NOTE window=" + root.x + "," + root.y + " " + root.width + "x" + root.height + " screenArea=" + a.x + "," + a.y + " " + a.width + "x" + a.height)
+ const cc = uiFind(proPage, i => i.objectName === "pro-subtitles", [])[0]
+ const au = uiFind(proPage, i => i.objectName === "pro-audio-tracks", [])[0]
+ if (!cc || !cc.visible || !au || !au.visible) return uiFail("pro subtitle/audio buttons missing")
+ const p = au.mapToGlobal(au.width / 2, au.height / 2)
+ uiLog("UITEST_CLICK " + p.x + " " + p.y)
+ }],
+ [1200, () => uiLog("UITEST_SHOT 01-pro-audio-menu")],
+ [800, () => uiLog("UITEST_KEY 27")],
+ [1000, () => {
+ root.uiStart = { x: root.x, y: root.y }
+ // Empty middle of the pro page header.
+ const x = root.x + root.width * 0.45, y = root.y + 30
+ uiLog("UITEST_DRAG " + x + " " + y + " " + (x + 120) + " " + (y + 70))
+ }],
+ [1500, () => {
+ const dx = root.x - root.uiStart.x, dy = root.y - root.uiStart.y
+ uiLog("UITEST_NOTE page drag moved " + dx + "," + dy)
+ if (dx < 95 || dy < 45) return uiFail("dragging the pro header moved the window by " + dx + "," + dy)
+ proPage.tab = "audio"
+ veyra.volume = 0.5
+ }],
+ [1200, () => {
+ // A slider in the inspector: the first visible one (the 声音 tab's volume).
+ const sliders = uiFind(proPage, i => i.keyStep !== undefined && i.visible && i.enabledControl && i.width > 40, [])
+ if (!sliders.length) return uiFail("no slider found")
+ root.uiSlider = sliders[0]
+ const s = root.uiSlider
+ root.uiStart = { v: s.value }
+ const k = s.mapToGlobal(s.width * s.frac, s.height / 2)
+ uiLog("UITEST_NOTE slider value=" + s.value.toFixed(3) + " range=" + s.from + ".." + s.to + " keyStep=" + s.keyStep)
+ uiLog("UITEST_CLICK " + k.x + " " + k.y)
+ }],
+ [1000, () => { uiLog("UITEST_NOTE before keys focus=" + root.uiSlider.activeFocus + " windowActive=" + root.active); uiLog("UITEST_KEY 39 3") }],
+ [1500, () => {
+ const s = root.uiSlider
+ const moved = s.value - root.uiStart.v
+ uiLog("UITEST_NOTE slider after 3x Right: " + s.value.toFixed(3) + " (moved " + moved.toFixed(3) + ", focus=" + s.activeFocus + ")")
+ if (!s.activeFocus || Math.abs(moved - 3 * s.keyStep) > s.keyStep * 0.6 + 0.0001)
+ return uiFail("arrow keys moved the slider by " + moved + " (step " + s.keyStep + ")")
+ uiLog("UITEST_KEY 37 3")
+ }],
+ [1500, () => {
+ const s = root.uiSlider
+ if (Math.abs(s.value - root.uiStart.v) > s.keyStep * 0.6 + 0.0001) return uiFail("Left did not move back: " + s.value)
+ uiLog("UITEST_KEY 27")
+ root.goPage("min")
+ }],
+ [2500, () => {
+ if (!fullBar.visible) return uiFail("pill not shown on 极简")
+ dock.requestTogglePill()
+ }],
+ [1500, () => {
+ if (fullBar.visible || !root.pillHidden) return uiFail("pill still shown after hiding")
+ uiLog("UITEST_SHOT 02-min-pill-hidden")
+ dock.requestTogglePill()
+ }],
+ [1500, () => {
+ if (!fullBar.visible || root.pillHidden) return uiFail("pill not back")
+ uiLog("UITEST_DONE")
+ }]
+ ]
+ Timer {
+ id: uiRun
+ property int step: 0
+ property bool failed: false
+ running: true
+ interval: root.uiSteps[0][0]
+ onTriggered: {
+ root.uiSteps[step][1]()
+ step += 1
+ if (!failed && step < root.uiSteps.length) { interval = root.uiSteps[step][0]; restart() }
+ }
+ }
diff --git a/scripts/ui-check/ui-check.py b/scripts/ui-check/ui-check.py
index fdd3b9dc..6e414cb1 100644
--- a/scripts/ui-check/ui-check.py
+++ b/scripts/ui-check/ui-check.py
@@ -9,6 +9,7 @@ through log lines:
UITEST_SHOT <name> screen shot of the main window plus the 60px below it (the pill)
UITEST_CLICK <x> <y> a left click at screen coordinates
UITEST_DRAG <x0> <y0> <x1> <y1> a left-button drag at screen coordinates
+ UITEST_KEY <vk> [count] key presses (Windows virtual-key code) to the focused window
UITEST_DONE / UITEST_FAIL <why> the verdict
The log is flushed by the next log call, so the snippet keeps a heartbeat going.
Clicks and drags move the real pointer for about a second.
@@ -164,6 +165,25 @@ try:
drag(x0, y0, x1, y1)
finally:
raise_app(proc.pid, False)
+ elif 'UITEST_KEY ' in line:
+ # UITEST_KEY <virtual-key code> [count]: key presses to the foreground window.
+ parts = line.split('UITEST_KEY ')[1].split()
+ vk, count = int(parts[0]), int(parts[1]) if len(parts) > 1 else 1
+ win = main_window(proc.pid)
+ if win:
+ user32.SetForegroundWindow(ctypes.c_void_p(win[0]))
+ time.sleep(0.2)
+ fg = user32.GetForegroundWindow()
+ owner = ctypes.c_ulong()
+ user32.GetWindowThreadProcessId(ctypes.c_void_p(fg), ctypes.byref(owner))
+ if owner.value != proc.pid:
+ print('key skipped: the app is not the foreground window')
+ continue
+ for _ in range(count):
+ user32.keybd_event(vk, 0, 0, 0)
+ time.sleep(0.05)
+ user32.keybd_event(vk, 0, 2, 0)
+ time.sleep(0.15)
elif 'UITEST_NOTE ' in line:
print(line.split('UITEST_NOTE ', 1)[1].strip())
elif 'UITEST_FAIL' in line:
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index fe935955..91a6619a 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -1,6 +1,8 @@
#include "veyra/ui/QmlPlayerBridge.h"
#include <QRegion>
+#include <QCursor>
+#include <QScreen>
#include <QWindow>
#include <QDateTime>
@@ -1464,7 +1466,17 @@ QVariantList QmlPlayerBridge::captureAudioInputs() const {
int QmlPlayerBridge::captureAudioChoice() const { return impl_->captureAudioChoice; }
void QmlPlayerBridge::setCaptureAudioChoice(int choice) {
if (choice < source::kCaptureAudioFromVideoDevice || choice >= int(impl_->captureAudio.size())) return;
- impl_->captureAudioChoice = choice; emit captureChanged();
+ impl_->captureAudioChoice = choice;
+ // Remember the audio choice for this device as soon as it is picked, not only on
+ // 连接并开始 (field report 2026-10-01: picked, closed, and it was gone next time).
+ auto& i = *impl_;
+ if (!i.captureDevice.empty() && i.captureDevice == i.capturePrefs.videoPath) {
+ const source::CaptureDevice* audio = choice >= 0 && size_t(choice) < i.captureAudio.size() ? &i.captureAudio[size_t(choice)] : nullptr;
+ i.capturePrefs.audioPath = audio ? audio->path : std::wstring{};
+ i.capturePrefs.audioMode = audio ? (audio->wasapi ? source::kCaptureAudioWasapi : 0) : choice;
+ if (!ui::CapturePreferenceStore(i.dataDir).save(i.capturePrefs)) veyra::log::warn("capture-ui", "capture audio choice not saved");
+ }
+ emit captureChanged();
}
int QmlPlayerBridge::captureColorSpace() const { return int(source::captureColorSpace(impl_->captureColor)); }
void QmlPlayerBridge::setCaptureColorSpace(int value) {
@@ -4124,13 +4136,23 @@ void QmlPlayerBridge::rememberWindowSize(int width, int height) {
impl_->prefs[QStringLiteral("lastWindow")] = v;
if (!impl_->savePrefs()) veyra::log::warn("ui-prefs", "last window size not saved");
}
+QRect QmlPlayerBridge::screenAvailableAt(int x, int y) const {
+ QScreen* screen = QGuiApplication::screenAt(QPoint(x, y));
+ if (!screen) screen = QGuiApplication::primaryScreen();
+ return screen ? screen->availableGeometry() : QRect(0, 0, 1920, 1040);
+}
+QRect QmlPlayerBridge::launchScreenAvailable() const {
+ const QPoint at = QCursor::pos();
+ return screenAvailableAt(at.x(), at.y());
+}
+
bool QmlPlayerBridge::setPreference(const QString& key, const QVariant& value) {
static const QHash<QString, std::pair<int, int>> ranges{
{"subtitleSize", {16, 56}}, {"subtitleFont", {0, 5}}, {"subtitleOutline", {0, 3}},
{"subtitleMargin", {0, 240}}, {"subtitleLines", {0, 8}}};
static const QStringList flags{"subtitleEnabled", "subtitleBackground", "subtitleFit",
"subtitleSecondLanguage", "audioForceStereo", "holdCompare",
- "magewellLowLatency"};
+ "magewellLowLatency", "cinePillHidden"};
QVariant stored;
if (ranges.contains(key)) {
bool ok = false; const int n = value.toInt(&ok);
@@ -4145,6 +4167,11 @@ bool QmlPlayerBridge::setPreference(const QString& key, const QVariant& value) {
stored = dir;
} else if (key == QLatin1String("audioDevice")) {
stored = value.toString();
+ } else if (key == QLatin1String("sliderKeyStep")) {
+ // Arrow-key step of a focused slider (设置 → 通用): 1, 0.1 or 0.01.
+ bool ok = false; const double v = value.toDouble(&ok);
+ if (!ok || !(qFuzzyCompare(v, 1.0) || qFuzzyCompare(v, 0.1) || qFuzzyCompare(v, 0.01))) return false;
+ stored = v;
} else if (key == QLatin1String("accent")) {
const QString v = value.toString();
if (v != QLatin1String("orange") && v != QLatin1String("white")) return false;