本文整理汇总了TypeScript中electron.BrowserWindow.show方法的典型用法代码示例。如果您正苦于以下问题:TypeScript BrowserWindow.show方法的具体用法?TypeScript BrowserWindow.show怎么用?TypeScript BrowserWindow.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类electron.BrowserWindow
的用法示例。
在下文中一共展示了BrowserWindow.show方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
webContents.on('dom-ready', async () => {
await updateAppMenu();
webContents.insertCSS(readFileSync(path.join(__dirname, '..', 'css', 'browser.css'), 'utf8'));
webContents.insertCSS(readFileSync(path.join(__dirname, '..', 'css', 'dark-mode.css'), 'utf8'));
webContents.insertCSS(readFileSync(path.join(__dirname, '..', 'css', 'vibrancy.css'), 'utf8'));
webContents.insertCSS(
readFileSync(path.join(__dirname, '..', 'css', 'code-blocks.css'), 'utf8')
);
if (config.get('useWorkChat')) {
webContents.insertCSS(
readFileSync(path.join(__dirname, '..', 'css', 'workchat.css'), 'utf8')
);
}
if (existsSync(path.join(app.getPath('userData'), 'custom.css'))) {
webContents.insertCSS(readFileSync(path.join(app.getPath('userData'), 'custom.css'), 'utf8'));
}
if (config.get('launchMinimized') || app.getLoginItemSettings().wasOpenedAsHidden) {
mainWindow.hide();
} else {
mainWindow.show();
}
webContents.send('toggle-mute-notifications', config.get('notificationsMuted'));
webContents.send('toggle-message-buttons', config.get('showMessageButtons'));
webContents.executeJavaScript(
readFileSync(path.join(__dirname, 'notifications-isolated.js'), 'utf8')
);
});
示例2:
const toggleWin = (): void => {
if (win.isVisible()) {
win.hide();
} else {
win.show();
}
};
示例3: Promise
return new Promise(resolve => {
if (isDev || !isAnySetupRequired()) {
const {
loadExtensions
} = require("eez-studio-shared/extensions/extensions") as typeof ExtensionsModule;
loadExtensions();
resolve();
return;
}
let win = new BrowserWindow({
width: 600,
height: 200,
backgroundColor: "#333",
show: false
});
win.setMenu(null);
win.loadURL(`file://${__dirname}/../setup/setup.html`);
win.show();
ipcMain.on("startSetup", async (event: Event) => {
await doSetup(event.sender);
win.close();
resolve();
});
});
示例4: onMainWindowReady
ipcMain.on('main-window-ready', function onMainWindowReady() {
// do not show windows before react is ready
if (mainWindow) {
mainWindow.show();
mainWindow.focus();
}
});
示例5: Error
mainWindow.webContents.on("did-finish-load", () => {
if (!mainWindow) {
throw new Error('"mainWindow" is not defined');
}
mainWindow.show();
mainWindow.focus();
});
示例6:
app.on('second-instance', () => {
if (mainWindow) {
if (mainWindow.isMinimized()) {
mainWindow.restore();
}
mainWindow.show();
}
});
示例7:
click: menuItem => {
if (win == null) {
return;
}
if (win.isVisible()) {
win.hide();
} else {
win.show();
}
}
示例8: switch
electron.ipcMain.on('loadWindow', (event, arg) => {
switch (arg) {
case 1:
mainWindow.hide();
registerWindow.show();
break;
case 2:
registerWindow.hide();
mainWindow.show();
break;
case 3:
mainWindow.loadURL('file://' + __dirname + '/views/chat.html');
break;
case 4:
mainWindow.loadURL('file://' + __dirname + '/views/room.html');
break;
default:
registerWindow.hide();
mainWindow.show();
}
socket.removeAllListeners("receive");
});
示例9:
electron.app.on('ready', () => {
const mainWindow = new electron.BrowserWindow({
width: 1024,
height: 768,
minWidth: 320,
minHeight: 240,
acceptFirstMouse: true,
title: 'GridPrompt',
titleBarStyle: 'hidden'
});
mainWindow.loadURL(`file://${__dirname}/../ui/index.html`);
mainWindow.show();
});