Skip to content

Commit 76bc7db

Browse files
committed
add fullscreen
1 parent 9b3da46 commit 76bc7db

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

examples/example.c3p

-95 Bytes
Binary file not shown.

src/instance.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,18 @@ function getInstanceJs(parentClass, addonTriggers, C3) {
576576
await this.ws?.sendAndWaitForResponse(order)
577577
}, this.unsupportedEngine)
578578

579+
_SetFullscreen = this.wrap(super._SetFullscreen, async (toggle) => {
580+
/** @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetFullscreen, 'input'>} */
581+
const order = {
582+
url: '/window/set-fullscreen',
583+
body: {
584+
value: toggle
585+
}
586+
}
587+
588+
await this.ws?.sendAndWaitForResponse(order)
589+
}, this.unsupportedEngine)
590+
579591
_Unmaximize = this.wrap(super._Unmaximize, async () => {
580592
/** @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageWindowUnmaximize, 'input'>} */
581593
const order = {

src/pluginConfig.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,29 @@ const Config = /** @type {const} */({
892892
displayText: "Unmaximize window",
893893
description: "Unmaximize the window",
894894
},
895+
896+
SetFullscreen: {
897+
category: "window",
898+
forward: "_SetFullscreen",
899+
highlight: false,
900+
deprecated: false,
901+
isAsync: true,
902+
params: [
903+
{
904+
id: 'fullscreen',
905+
desc: "Whether to set fullscreen or not.",
906+
name: "Fullscreen",
907+
type: 'combo',
908+
items: [
909+
{ "normal": "Normal" },
910+
{ "fullscreen": "Fullscreen" },
911+
]
912+
}
913+
],
914+
listName: "Set Fullscreen",
915+
displayText: "Set fullscreen {0}",
916+
description: "Change fullscreen state",
917+
}
895918
},
896919
Cnds: {
897920
IsEngine: {

0 commit comments

Comments
 (0)