本文整理匯總了TypeScript中electron.BrowserWindow.isFullScreen方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BrowserWindow.isFullScreen方法的具體用法?TypeScript BrowserWindow.isFullScreen怎麽用?TypeScript BrowserWindow.isFullScreen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類electron.BrowserWindow
的用法示例。
在下文中一共展示了BrowserWindow.isFullScreen方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: _saveState
private _saveState(): void {
const isMaximized = this._window.isMaximized()
const isFullScreen = this._window.isFullScreen()
this._state = { isFullScreen, isMaximized }
if (!(isMaximized || isFullScreen)) {
this._state.bounds = this._window.getBounds()
}
appConfig.set(this._stateName, this._state as any)
}
示例2:
main.on('close', event => {
if (!isQuitting) {
event.preventDefault();
logger.log('Closing window...');
if (main.isFullScreen()) {
logger.log('Fullscreen detected, leaving full screen before hiding...');
main.once('leave-full-screen', () => main.hide());
main.setFullScreen(false);
} else {
main.hide();
}
}
systemMenu.unregisterShortcuts();
});
示例3:
click:() => {
(mainWindow as any).setFullScreen(!mainWindow.isFullScreen());
}