diff --git a/control/electron/helpers/index.js b/control/electron/helpers/index.js index 1c047336..1549fda4 100644 --- a/control/electron/helpers/index.js +++ b/control/electron/helpers/index.js @@ -10,8 +10,9 @@ export function initControlWindow(mainWindow) { const controlWindow = new BrowserWindow({ icon: getLogoPath(), - width: 500, - minWidth: 500, + parent: mainWindow, + width: 700, + minWidth: 700, height: 28, maxHeight: 28, frame: false, diff --git a/src/components/Device/components/ControlBar/index.vue b/src/components/Device/components/ControlBar/index.vue index 26e424b9..65dc233e 100644 --- a/src/components/Device/components/ControlBar/index.vue +++ b/src/components/Device/components/ControlBar/index.vue @@ -117,6 +117,12 @@ export default { elIcon: 'Back', command: 'input keyevent 4', }, + { + label: 'device.control.turnScreenOff', + elIcon: 'TurnOff', + scrcpyCommand: '--turn-screen-off', + tips: 'device.control.turnScreenOff.tips', + }, { label: 'device.control.notification', elIcon: 'Notification', @@ -203,13 +209,16 @@ export default { this.$refs.scrollableRef.scrollForward() }, handleClick(row, trigger) { - if (row?.command) { - this.$adb.deviceShell(this.device.id, row.command) + if (trigger) { + trigger(row) return false } - if (trigger) { - trigger(row) + if (row?.command) { + this.$adb.deviceShell(this.device.id, row.command) + } + else if (row?.scrcpyCommand) { + this.$scrcpy.control(this.device.id, { command: row.scrcpyCommand }) } }, }, diff --git a/src/components/Device/index.vue b/src/components/Device/index.vue index 550459d6..0751aaa4 100644 --- a/src/components/Device/index.vue +++ b/src/components/Device/index.vue @@ -86,7 +86,7 @@