Code/JavaScript

[Electron] 윈도우 크기 위치 기억, 복원

codens 2020. 11. 27. 17:48

 

mawie81 /electron-window-state 

https://github.com/mawie81/electron-window-state - 491

    - v5.0.3 , 2018/11

 

//-------------------------------------

    - 설치
> npm install --save electron-window-state

 

//-----------------------------------------

 

const windowStateKeeper = require('electron-window-state');

 

function createWindow() {

    let mainWindowState = windowStateKeeper({

        defaultWidth: 1000,

        defaultHeight: 800

    });

 

    const win = new BrowserWindow({

        x: mainWindowState.x,

        y: mainWindowState.y,

        width: mainWindowState.width,

        height: mainWindowState.height

    });

 

    mainWindowState.manage(win);

 

반응형