mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2025-04-21 04:25:13 +08:00
feat(Sidebar): set screen mode
This commit is contained in:
parent
95b302c39f
commit
63fa9eb73c
@ -2,9 +2,7 @@
|
|||||||
"$schema": "../gen/schemas/desktop-schema.json",
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
"identifier": "default",
|
"identifier": "default",
|
||||||
"description": "Capability for the main window",
|
"description": "Capability for the main window",
|
||||||
"windows": [
|
"windows": ["main"],
|
||||||
"main"
|
|
||||||
],
|
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"event:default",
|
"event:default",
|
||||||
"window:default",
|
"window:default",
|
||||||
@ -27,6 +25,8 @@
|
|||||||
"clipboard-manager:default",
|
"clipboard-manager:default",
|
||||||
"clipboard-manager:allow-write-text",
|
"clipboard-manager:allow-write-text",
|
||||||
"process:default",
|
"process:default",
|
||||||
"process:allow-restart"
|
"process:allow-restart",
|
||||||
|
"webview:default",
|
||||||
|
"webview:allow-internal-toggle-devtools"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -9,22 +9,30 @@ import {
|
|||||||
VolumeLowOutline,
|
VolumeLowOutline,
|
||||||
StopOutline,
|
StopOutline,
|
||||||
ListOutline,
|
ListOutline,
|
||||||
|
BulbOutline,
|
||||||
|
Bulb,
|
||||||
} from "@vicons/ionicons5";
|
} from "@vicons/ionicons5";
|
||||||
import { Keyboard24Regular } from "@vicons/fluent";
|
import { Keyboard24Regular } from "@vicons/fluent";
|
||||||
import { NIcon, useMessage } from "naive-ui";
|
import { NIcon, useMessage } from "naive-ui";
|
||||||
import { useGlobalStore } from "../store/global";
|
import { useGlobalStore } from "../store/global";
|
||||||
import { sendInjectKeycode } from "../frontcommand/controlMsg";
|
import {
|
||||||
|
sendInjectKeycode,
|
||||||
|
sendSetScreenPowerMode,
|
||||||
|
} from "../frontcommand/controlMsg";
|
||||||
import {
|
import {
|
||||||
AndroidKeyEventAction,
|
AndroidKeyEventAction,
|
||||||
AndroidKeycode,
|
AndroidKeycode,
|
||||||
AndroidMetastate,
|
AndroidMetastate,
|
||||||
} from "../frontcommand/android";
|
} from "../frontcommand/android";
|
||||||
|
import { ref } from "vue";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const store = useGlobalStore();
|
const store = useGlobalStore();
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
|
|
||||||
|
const nextScreenPowerMode = ref(0);
|
||||||
|
|
||||||
function nav(name: string) {
|
function nav(name: string) {
|
||||||
router.replace({ name });
|
router.replace({ name });
|
||||||
}
|
}
|
||||||
@ -88,6 +96,17 @@ async function sendKeyCodeToDevice(code: AndroidKeycode) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
|
<div
|
||||||
|
@click="
|
||||||
|
sendSetScreenPowerMode({ mode: nextScreenPowerMode });
|
||||||
|
nextScreenPowerMode = nextScreenPowerMode ? 0 : 2;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<NIcon>
|
||||||
|
<Bulb v-if="nextScreenPowerMode" />
|
||||||
|
<BulbOutline v-else />
|
||||||
|
</NIcon>
|
||||||
|
</div>
|
||||||
<div @click="sendKeyCodeToDevice(AndroidKeycode.AKEYCODE_VOLUME_UP)">
|
<div @click="sendKeyCodeToDevice(AndroidKeycode.AKEYCODE_VOLUME_UP)">
|
||||||
<NIcon>
|
<NIcon>
|
||||||
<VolumeHighOutline />
|
<VolumeHighOutline />
|
||||||
|
@ -18,8 +18,6 @@ import { DropdownOption, NDropdown, useDialog, useMessage } from "naive-ui";
|
|||||||
import { onBeforeRouteLeave } from "vue-router";
|
import { onBeforeRouteLeave } from "vue-router";
|
||||||
import { useKeyboardStore } from "../../store/keyboard";
|
import { useKeyboardStore } from "../../store/keyboard";
|
||||||
|
|
||||||
// TODO 添加开发者工具打开按钮
|
|
||||||
// TODO 添加息屏按键
|
|
||||||
// TODO 添加无线调试(rust加一条指令connet即可)
|
// TODO 添加无线调试(rust加一条指令connet即可)
|
||||||
|
|
||||||
const store = useGlobalStore();
|
const store = useGlobalStore();
|
||||||
|
Loading…
Reference in New Issue
Block a user