possible fix for docking sizing (#9)

This commit is contained in:
Eugene Pankov 2017-07-25 21:49:20 +02:00
parent 0fe2de591a
commit de29e34363
2 changed files with 4 additions and 2 deletions

View File

@ -76,6 +76,8 @@ setupWindowManagement = () => {
electron.ipcMain.on('window-set-bounds', (event, bounds) => {
let actualBounds = app.window.getBounds()
actualBounds.width -= bounds.x - actualBounds.x
actualBounds.height -= bounds.y - actualBounds.y
actualBounds.x = bounds.x
actualBounds.y = bounds.y
app.window.setBounds(actualBounds)

View File

@ -40,12 +40,12 @@ export class DockingService {
newBounds.height = Math.round(fill * display.bounds.height)
}
if (dockSide === 'right') {
newBounds.x = display.bounds.x + Math.round(display.bounds.width * (1.0 - fill))
newBounds.x = display.bounds.x + display.bounds.width - newBounds.width
} else {
newBounds.x = display.bounds.x
}
if (dockSide === 'bottom') {
newBounds.y = display.bounds.y + Math.round(display.bounds.height * (1.0 - fill))
newBounds.y = display.bounds.y + display.bounds.height - newBounds.height
} else {
newBounds.y = display.bounds.y
}