Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 6914ad7

Browse files
authored
Implemented minimizing (#33)
1 parent d780315 commit 6914ad7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

dist/server/api/window.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ router.post('/maximize', (req, res) => {
1616
(_a = state_1.default.windows[id]) === null || _a === void 0 ? void 0 : _a.maximize();
1717
res.sendStatus(200);
1818
});
19+
router.post('/minimize', (req, res) => {
20+
var _a;
21+
const { id } = req.body;
22+
(_a = state_1.default.windows[id]) === null || _a === void 0 ? void 0 : _a.minimize();
23+
res.sendStatus(200);
24+
});
1925
router.post('/resize', (req, res) => {
2026
var _a;
2127
const { id, width, height } = req.body;
@@ -69,7 +75,7 @@ router.post('/always-on-top', (req, res) => {
6975
res.sendStatus(200);
7076
});
7177
router.post('/open', (req, res) => {
72-
let { id, x, y, frame, width, height, minWidth, minHeight, maxWidth, maxHeight, focusable, hasShadow, url, resizable, movable, minimizable, maximizable, closable, title, alwaysOnTop, titleBarStyle, trafficLightPosition, vibrancy, backgroundColor, transparency, showDevTools, fullscreen, kiosk, autoHideMenuBar, } = req.body;
78+
let { id, x, y, frame, width, height, minWidth, minHeight, maxWidth, maxHeight, focusable, hasShadow, url, resizable, movable, minimizable, maximizable, closable, title, alwaysOnTop, titleBarStyle, trafficLightPosition, vibrancy, backgroundColor, transparency, showDevTools, fullscreen, fullscreenable, kiosk, autoHideMenuBar, } = req.body;
7379
if (state_1.default.windows[id]) {
7480
state_1.default.windows[id].show();
7581
state_1.default.windows[id].focus();
@@ -104,6 +110,7 @@ router.post('/open', (req, res) => {
104110
contextIsolation: false,
105111
nodeIntegration: true,
106112
}, fullscreen,
113+
fullscreenable,
107114
kiosk }));
108115
if ((process.env.NODE_ENV === 'development' || showDevTools === true) && showDevTools !== false) {
109116
window.webContents.openDevTools();

src/server/api/window.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ router.post('/maximize', (req, res) => {
1313
res.sendStatus(200)
1414
});
1515

16+
router.post('/minimize', (req, res) => {
17+
const {id} = req.body
18+
state.windows[id]?.minimize()
19+
20+
res.sendStatus(200)
21+
});
22+
1623
router.post('/resize', (req, res) => {
1724
const {id, width, height} = req.body
1825

0 commit comments

Comments
 (0)