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

Implemented minimizing #33

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dist/server/api/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ router.post('/maximize', (req, res) => {
(_a = state_1.default.windows[id]) === null || _a === void 0 ? void 0 : _a.maximize();
res.sendStatus(200);
});
router.post('/minimize', (req, res) => {
var _a;
const { id } = req.body;
(_a = state_1.default.windows[id]) === null || _a === void 0 ? void 0 : _a.minimize();
res.sendStatus(200);
});
router.post('/resize', (req, res) => {
var _a;
const { id, width, height } = req.body;
Expand Down Expand Up @@ -69,7 +75,7 @@ router.post('/always-on-top', (req, res) => {
res.sendStatus(200);
});
router.post('/open', (req, res) => {
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;
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;
if (state_1.default.windows[id]) {
state_1.default.windows[id].show();
state_1.default.windows[id].focus();
Expand Down Expand Up @@ -104,6 +110,7 @@ router.post('/open', (req, res) => {
contextIsolation: false,
nodeIntegration: true,
}, fullscreen,
fullscreenable,
kiosk }));
if ((process.env.NODE_ENV === 'development' || showDevTools === true) && showDevTools !== false) {
window.webContents.openDevTools();
Expand Down
7 changes: 7 additions & 0 deletions src/server/api/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ router.post('/maximize', (req, res) => {
res.sendStatus(200)
});

router.post('/minimize', (req, res) => {
const {id} = req.body
state.windows[id]?.minimize()

res.sendStatus(200)
});

router.post('/resize', (req, res) => {
const {id, width, height} = req.body

Expand Down
Loading