diff --git a/package.json b/package.json index 3350475..2ad8bcd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "media_player_client", - "version": "1.4.0", + "version": "1.4.1", "description": "A Quasar Framework app", "productName": "MediaPlayerClient", "author": "fangxiang ", diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index cfd4fad..ed2d54d 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -644,6 +644,12 @@ export default class ClientConnection { ); } + public windowFullScreen(window_id: number, full_screen: boolean) { + this.ws?.send( + JSON.stringify(new Protocol.WindowFullScreen(window_id, full_screen)) + ); + } + public async getSubtitle() { try { return await this.doRpc( diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 0e4870b..f1aa78a 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -385,6 +385,9 @@ export namespace Protocol { public static get kRpcSetConnectionItem() { return Commands.PROTOCOL_PREFIX + "RpcSetConnectionItem"; } + public static get kWindowFullScreen() { + return Commands.PROTOCOL_PREFIX + "WindowFullScreen"; + } static _all_commands = new Set([ Commands.kUnKnowCommand, @@ -482,8 +485,8 @@ export namespace Protocol { Commands.kRpcSetExternalControlSerialPortConfig, Commands.kRpcGetConnectionList, Commands.kRpcSetConnectionItem, + Commands.kWindowFullScreen, ]); - public static get AllCommands() { return this._all_commands; } @@ -2447,4 +2450,17 @@ export namespace Protocol { success = false; } + + export class WindowFullScreen extends PacketEntity { + constructor(window_id: number, full_screen: boolean, rpc_id = 0) { + super(); + super.command = Commands.kWindowFullScreen; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + this.window_id = window_id; + this.full_screen = full_screen; + } + window_id: number; + full_screen: boolean; + } } diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index 5db221b..a4c39f1 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -22,7 +22,8 @@ export default { "Please type something": "请输入内容", "grid setting": "宫格设置", - "background image": "底图设置", + "background image": "底图", + "background image setting": "底图设置", "data import": "数据导入", "data export": "数据导出", "database import": "数据恢复", @@ -477,4 +478,6 @@ export default { _SOFT_PAD_LOGIN_TITLE_: "软件管理平台", welcome: "欢迎", "plan running! can't open window!": "预案正在运行!不能开窗!", + "full screen window": "全屏", + "restore window size": "恢复", }; diff --git a/src/pad/TopToolbar.vue b/src/pad/TopToolbar.vue index 122ce88..9d3e7d9 100644 --- a/src/pad/TopToolbar.vue +++ b/src/pad/TopToolbar.vue @@ -4,7 +4,7 @@ style="flex-wrap: wrap" > + + + - +
{ + $q.fullscreen.request().catch((e: any) => { console.log(e); }); } @@ -226,7 +236,17 @@ export default defineComponent({ if (window) { GlobalData.getInstance() .getCurrentClient() - ?.setWindowGeometry(window.window_id, 0, 0, 1, 1); + ?.windowFullScreen(window.window_id, true); + } + }, + exitFullscreenWindow() { + const window = $store.state.windows.find( + (element) => element && element.uuid == $store.state.selected_window + ); + if (window) { + GlobalData.getInstance() + .getCurrentClient() + ?.windowFullScreen(window.window_id, false); } }, closeCurrentWindow() { diff --git a/src/pages/TopToolBar.vue b/src/pages/TopToolBar.vue index 27740a9..dc14417 100644 --- a/src/pages/TopToolBar.vue +++ b/src/pages/TopToolBar.vue @@ -225,7 +225,7 @@ - {{ $t("background image") }} + {{ $t("background image setting") }}