Skip to content

Commit e99b17d

Browse files
committed
minor change to fix window tiling making the window size not match
1 parent 0480746 commit e99b17d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/main.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function resizeBrowserView(minmax) {
196196
height: mainWindow.getBounds().height - 35
197197
})
198198
clearTimeout(timeout);
199-
}, 70);
199+
}, 10);
200200
} else {
201201
//if its not a min/max resize then just resize the browser view
202202
view.setBounds({
@@ -252,6 +252,12 @@ app.on('ready', () => {
252252
mainWindow.on('resize', () => {
253253
resizeBrowserView(false)
254254
})
255+
//a listener for if its tiled (really just watch for it being moved and not maximized)
256+
mainWindow.on('move', () => {
257+
if (mainWindow.isMaximized() === false) {
258+
resizeBrowserView(true);
259+
}
260+
})
255261
//get the lastOpen value from the store
256262
let lastOpen = store.get('lastOpen');
257263
//check if the lastOpen value is set and if it is then load it, if not then load tab1Url
@@ -274,7 +280,7 @@ app.on('ready', () => {
274280
//see if the dark mode is enabled
275281
if (store.get('darkMode') === true) {
276282
let darkLevel = store.get('darkLevel');
277-
//inject the css invert of 60% into the page and all text to white
283+
//inject the css invert of specified amount into the page and all text to white
278284
view.webContents.insertCSS(`html {-webkit-filter: invert(${darkLevel}%); filter: invert(${darkLevel}%); -webkit-transition: all 0.5s ease; transition: all 0.5s ease; color: white;}`)
279285
}
280286
} else {

0 commit comments

Comments
 (0)