修复添加轮询后使用键鼠菜单编辑不显示的BUG

工具栏添加窗口大小按钮
This commit is contained in:
fangxiang 2022-05-05 19:45:48 +08:00
parent a467423b1a
commit 4dedd8a584
9 changed files with 117 additions and 18 deletions

View File

@ -1,6 +1,6 @@
{
"name": "media_player_client",
"version": "1.4.2",
"version": "1.4.3",
"description": "A Quasar Framework app",
"productName": "MediaPlayerClient",
"author": "fangxiang <fangxiang@cloudview.work>",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -326,7 +326,7 @@ export default defineComponent({
},
addRow() {
datas.value.push({
key: "operator_signal_source",
key: "operator_play_signal_source",
value: GlobalData.getInstance().signal_source[0].uuid,
});

View File

@ -944,22 +944,22 @@ export default defineComponent({
label: "270°",
value: 3,
},
{
label: $t.t("horizontal flipped"),
value: 4,
},
{
label: $t.t("horizontal flipped") + "90°",
value: 5,
},
{
label: $t.t("horizontal flipped") + "180°",
value: 6,
},
{
label: $t.t("horizontal flipped") + "270°",
value: 7,
},
// {
// label: $t.t("horizontal flipped"),
// value: 4,
// },
// {
// label: $t.t("horizontal flipped") + "90°",
// value: 5,
// },
// {
// label: $t.t("horizontal flipped") + "180°",
// value: 6,
// },
// {
// label: $t.t("horizontal flipped") + "270°",
// value: 7,
// },
]);
let device_resolution_type = ref("EDID");
let device_resolution_type_options = ref([

View File

@ -19,6 +19,7 @@ export default {
close: "Close",
logout: "Logout",
"window rect": "Window Size",
"toolbar edit window rect": "Window Size",
"edit window rect": "Window Size Adjust",
"set the window rectangle beyond the desktop rectangle, the window rectangle will be clipped, are you sure to use this window rectangle":
"if the window size exceeds the desktop size, the window size will be clipped. Are you sure to use this window size",

View File

@ -496,4 +496,6 @@ export default {
function: "功能",
commit: "提交",
"set device function": "设置设备功能成功",
operator_play_signal_source: "信号源",
"toolbar edit window rect": "窗口大小",
};

View File

@ -67,6 +67,7 @@
:label="$t('win lower')"
@click="lowerWindow"
/>
<q-btn
v-if="function_center_control"
class="col-auto"
@ -119,6 +120,18 @@
class="col-auto"
@click="$refs.subtitle_dialog.showDialog()"
/>
<q-btn
stretch
flat
stack
no-caps
icon="img:pad/toolbar/edit_window_rect.png"
:label="$t('toolbar edit window rect')"
class="col-auto"
@click="editRect"
/>
<q-btn
class="col-auto"
stretch
@ -194,6 +207,7 @@
<center-control-dialog ref="center_control_dialog" />
<subtitle-dialog ref="subtitle_dialog" />
<advanced-debug-dialog ref="advanced_debug_dialog" />
<window-rect-edit-dialog ref="window_rect_edit_dialog" />
</template>
<script lang="ts">
@ -206,6 +220,7 @@ import FileManageDialog from "src/components/FileManageDialog.vue";
import SubtitleDialog from "src/components/SubtitleDialog.vue";
import CenterControlDialog from "src/components/CenterControlDialog.vue";
import AdvancedDebugDialog from "src/components/AdvancedDebugDialog.vue";
import WindowRectEditDialog from "src/components/WindowRectEditDialog.vue";
import GlobalData from "src/common/GlobalData";
import { Protocol } from "src/entities/WSProtocol";
@ -218,12 +233,15 @@ export default defineComponent({
CenterControlDialog,
SubtitleDialog,
AdvancedDebugDialog,
WindowRectEditDialog,
},
setup() {
const $store = useStore();
const $q = useQuasar();
const $t = useI18n();
const window_rect_edit_dialog: Ref<any> = ref(null);
const plan_running = computed(
() => $store.state.current_running_plan.trim() != ""
);
@ -245,6 +263,7 @@ export default defineComponent({
return {
plan_running,
function_center_control,
window_rect_edit_dialog,
toogleFullScreen() {
if (!$q.fullscreen.isCapable) {
@ -400,6 +419,36 @@ export default defineComponent({
timeout: 1500,
});
},
async editRect() {
if (window_rect_edit_dialog.value) {
try {
const window = $store.state.windows.find(
(element) =>
element && element.uuid == $store.state.selected_window
);
if (window) {
const result =
await window_rect_edit_dialog.value.showDialogAsync(
window.x * $store.state.device_screen_width,
window.y * $store.state.device_screen_height,
window.width * $store.state.device_screen_width,
window.height * $store.state.device_screen_height
);
if (result) {
let { x, y, width, height } = result;
x /= $store.state.device_screen_width;
y /= $store.state.device_screen_height;
width /= $store.state.device_screen_width;
height /= $store.state.device_screen_height;
GlobalData.getInstance()
.getCurrentClient()
?.setWindowGeometry(window.window_id, x, y, width, height);
}
}
} catch {}
}
},
};
},
});

View File

@ -132,6 +132,17 @@
@click="lowerWindow"
/>
<q-btn
stretch
flat
stack
:disable="plan_running"
:icon="/*vertical_align_bottom*/ 'img:new_icon/edit_window_rect.png'"
:label="$t('toolbar edit window rect')"
class="q-mr-sm"
@click="editRect"
/>
<q-btn
stretch
flat
@ -347,6 +358,7 @@
<register-dialog ref="register_dialog" />
<center-control-dialog ref="center_control_dialog" />
<advanced-debug-dialog ref="advanced_debug_dialog" />
<window-rect-edit-dialog ref="window_rect_edit_dialog" />
</template>
<style scoped>
@ -381,6 +393,7 @@ import EdgeBlendingDialog from "src/components/EdgeBlendingDialog.vue";
import RegisterDialog from "src/components/RegisterDialog.vue";
import CenterControlDialog from "src/components/CenterControlDialog.vue";
import AdvancedDebugDialog from "src/components/AdvancedDebugDialog.vue";
import WindowRectEditDialog from "src/components/WindowRectEditDialog.vue";
import EventBus, { EventNamesDefine } from "src/common/EventBus";
import { Protocol } from "src/entities/WSProtocol";
@ -414,6 +427,7 @@ export default defineComponent({
RegisterDialog,
CenterControlDialog,
AdvancedDebugDialog,
WindowRectEditDialog,
},
setup() {
@ -437,6 +451,8 @@ export default defineComponent({
let server_run_time = 0;
let server_all_run_time = 0;
const window_rect_edit_dialog: Ref<any> = ref(null);
const plan_running = computed(
() => $store.state.current_running_plan.trim() != ""
);
@ -540,6 +556,7 @@ export default defineComponent({
edge_blending_dialog,
register_dialog,
function_center_control,
window_rect_edit_dialog,
async backupDB() {
let client = GlobalData.getInstance().getCurrentClient();
@ -785,6 +802,36 @@ export default defineComponent({
}
}
},
async editRect() {
if (window_rect_edit_dialog.value) {
try {
const window = $store.state.windows.find(
(element) =>
element && element.uuid == $store.state.selected_window
);
if (window) {
const result =
await window_rect_edit_dialog.value.showDialogAsync(
window.x * $store.state.device_screen_width,
window.y * $store.state.device_screen_height,
window.width * $store.state.device_screen_width,
window.height * $store.state.device_screen_height
);
if (result) {
let { x, y, width, height } = result;
x /= $store.state.device_screen_width;
y /= $store.state.device_screen_height;
width /= $store.state.device_screen_width;
height /= $store.state.device_screen_height;
GlobalData.getInstance()
.getCurrentClient()
?.setWindowGeometry(window.window_id, x, y, width, height);
}
}
} catch {}
}
},
};
},
});