修复添加轮询后使用键鼠菜单编辑不显示的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", "name": "media_player_client",
"version": "1.4.2", "version": "1.4.3",
"description": "A Quasar Framework app", "description": "A Quasar Framework app",
"productName": "MediaPlayerClient", "productName": "MediaPlayerClient",
"author": "fangxiang <fangxiang@cloudview.work>", "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() { addRow() {
datas.value.push({ datas.value.push({
key: "operator_signal_source", key: "operator_play_signal_source",
value: GlobalData.getInstance().signal_source[0].uuid, value: GlobalData.getInstance().signal_source[0].uuid,
}); });

View File

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

View File

@ -19,6 +19,7 @@ export default {
close: "Close", close: "Close",
logout: "Logout", logout: "Logout",
"window rect": "Window Size", "window rect": "Window Size",
"toolbar edit window rect": "Window Size",
"edit window rect": "Window Size Adjust", "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": "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", "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: "功能", function: "功能",
commit: "提交", commit: "提交",
"set device function": "设置设备功能成功", "set device function": "设置设备功能成功",
operator_play_signal_source: "信号源",
"toolbar edit window rect": "窗口大小",
}; };

View File

@ -67,6 +67,7 @@
:label="$t('win lower')" :label="$t('win lower')"
@click="lowerWindow" @click="lowerWindow"
/> />
<q-btn <q-btn
v-if="function_center_control" v-if="function_center_control"
class="col-auto" class="col-auto"
@ -119,6 +120,18 @@
class="col-auto" class="col-auto"
@click="$refs.subtitle_dialog.showDialog()" @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 <q-btn
class="col-auto" class="col-auto"
stretch stretch
@ -194,6 +207,7 @@
<center-control-dialog ref="center_control_dialog" /> <center-control-dialog ref="center_control_dialog" />
<subtitle-dialog ref="subtitle_dialog" /> <subtitle-dialog ref="subtitle_dialog" />
<advanced-debug-dialog ref="advanced_debug_dialog" /> <advanced-debug-dialog ref="advanced_debug_dialog" />
<window-rect-edit-dialog ref="window_rect_edit_dialog" />
</template> </template>
<script lang="ts"> <script lang="ts">
@ -206,6 +220,7 @@ import FileManageDialog from "src/components/FileManageDialog.vue";
import SubtitleDialog from "src/components/SubtitleDialog.vue"; import SubtitleDialog from "src/components/SubtitleDialog.vue";
import CenterControlDialog from "src/components/CenterControlDialog.vue"; import CenterControlDialog from "src/components/CenterControlDialog.vue";
import AdvancedDebugDialog from "src/components/AdvancedDebugDialog.vue"; import AdvancedDebugDialog from "src/components/AdvancedDebugDialog.vue";
import WindowRectEditDialog from "src/components/WindowRectEditDialog.vue";
import GlobalData from "src/common/GlobalData"; import GlobalData from "src/common/GlobalData";
import { Protocol } from "src/entities/WSProtocol"; import { Protocol } from "src/entities/WSProtocol";
@ -218,12 +233,15 @@ export default defineComponent({
CenterControlDialog, CenterControlDialog,
SubtitleDialog, SubtitleDialog,
AdvancedDebugDialog, AdvancedDebugDialog,
WindowRectEditDialog,
}, },
setup() { setup() {
const $store = useStore(); const $store = useStore();
const $q = useQuasar(); const $q = useQuasar();
const $t = useI18n(); const $t = useI18n();
const window_rect_edit_dialog: Ref<any> = ref(null);
const plan_running = computed( const plan_running = computed(
() => $store.state.current_running_plan.trim() != "" () => $store.state.current_running_plan.trim() != ""
); );
@ -245,6 +263,7 @@ export default defineComponent({
return { return {
plan_running, plan_running,
function_center_control, function_center_control,
window_rect_edit_dialog,
toogleFullScreen() { toogleFullScreen() {
if (!$q.fullscreen.isCapable) { if (!$q.fullscreen.isCapable) {
@ -400,6 +419,36 @@ export default defineComponent({
timeout: 1500, 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" @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 <q-btn
stretch stretch
flat flat
@ -347,6 +358,7 @@
<register-dialog ref="register_dialog" /> <register-dialog ref="register_dialog" />
<center-control-dialog ref="center_control_dialog" /> <center-control-dialog ref="center_control_dialog" />
<advanced-debug-dialog ref="advanced_debug_dialog" /> <advanced-debug-dialog ref="advanced_debug_dialog" />
<window-rect-edit-dialog ref="window_rect_edit_dialog" />
</template> </template>
<style scoped> <style scoped>
@ -381,6 +393,7 @@ import EdgeBlendingDialog from "src/components/EdgeBlendingDialog.vue";
import RegisterDialog from "src/components/RegisterDialog.vue"; import RegisterDialog from "src/components/RegisterDialog.vue";
import CenterControlDialog from "src/components/CenterControlDialog.vue"; import CenterControlDialog from "src/components/CenterControlDialog.vue";
import AdvancedDebugDialog from "src/components/AdvancedDebugDialog.vue"; import AdvancedDebugDialog from "src/components/AdvancedDebugDialog.vue";
import WindowRectEditDialog from "src/components/WindowRectEditDialog.vue";
import EventBus, { EventNamesDefine } from "src/common/EventBus"; import EventBus, { EventNamesDefine } from "src/common/EventBus";
import { Protocol } from "src/entities/WSProtocol"; import { Protocol } from "src/entities/WSProtocol";
@ -414,6 +427,7 @@ export default defineComponent({
RegisterDialog, RegisterDialog,
CenterControlDialog, CenterControlDialog,
AdvancedDebugDialog, AdvancedDebugDialog,
WindowRectEditDialog,
}, },
setup() { setup() {
@ -437,6 +451,8 @@ export default defineComponent({
let server_run_time = 0; let server_run_time = 0;
let server_all_run_time = 0; let server_all_run_time = 0;
const window_rect_edit_dialog: Ref<any> = ref(null);
const plan_running = computed( const plan_running = computed(
() => $store.state.current_running_plan.trim() != "" () => $store.state.current_running_plan.trim() != ""
); );
@ -540,6 +556,7 @@ export default defineComponent({
edge_blending_dialog, edge_blending_dialog,
register_dialog, register_dialog,
function_center_control, function_center_control,
window_rect_edit_dialog,
async backupDB() { async backupDB() {
let client = GlobalData.getInstance().getCurrentClient(); 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 {}
}
},
}; };
}, },
}); });