Skip to content

Commit b9bd40b

Browse files
Fix Window Frame
- Fixed issue with the expand frame button
1 parent c882318 commit b9bd40b

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/frame.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ maximizeButton_el.addEventListener('click', () => {
1010
api.frameHandler({request: 'Maximize'});
1111
});
1212

13-
1413
exitButton_el.addEventListener('click', () => {
1514
api.frameHandler({request: 'Exit'});
1615
});

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const sqlite3 = require('sqlite3').verbose();
99
const appDataPath = app.getPath('userData');
1010
const db = new sqlite3.Database(`${appDataPath}/database.db`);
1111

12+
let frameMaximized;
13+
1214
// palette: https://coolors.co/f1f1f1-1b1b1b-252525-313131-9593d9-7c90db-889ade-24d05b-de2b2b
1315

1416

@@ -83,20 +85,19 @@ const createWindow = () => {
8385
}
8486

8587
mainWindow.on('resize', () => {
88+
const { width: newWidth, height: newHeight } = mainWindow.getBounds();
8689
if (!mainWindow.isMaximized()) {
87-
const { width: newWidth, height: newHeight } = mainWindow.getBounds();
8890
store.set('windowBounds', { width: newWidth, height: newHeight, x: mainWindow.getPosition()[0], y: mainWindow.getPosition()[1], isMaximized: false });
89-
frameMaximized = false;
9091
} else {
9192
store.set('windowBounds', { width, height, x, y, isMaximized: true });
92-
frameMaximized = true;
9393
}
9494
});
9595

9696
mainWindow.on('move', () => {
9797
if (!mainWindow.isMaximized()) {
9898
const [newX, newY] = mainWindow.getPosition();
9999
store.set('windowBounds', { width, height, x: newX, y: newY, isMaximized: false });
100+
frameMaximized = false;
100101
}
101102
});
102103

@@ -176,7 +177,6 @@ app.on('activate', () => {
176177
}
177178
});
178179

179-
let frameMaximized;
180180
ipcMain.handle('frame-handler', (req, data) => {
181181
if (!data || !data.request) return;
182182
switch(data.request){

0 commit comments

Comments
 (0)