當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript BrowserWindow.hide方法代碼示例

本文整理匯總了TypeScript中electron.BrowserWindow.hide方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BrowserWindow.hide方法的具體用法?TypeScript BrowserWindow.hide怎麽用?TypeScript BrowserWindow.hide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在electron.BrowserWindow的用法示例。


在下文中一共展示了BrowserWindow.hide方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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')
		);
	});
開發者ID:kusamakura,項目名稱:caprine,代碼行數:33,代碼來源:index.ts

示例2:

 mainWindow.on('close', e => {
   if (!isQuitting) {
     e.preventDefault()
     mainWindow.blur()
     mainWindow.hide()
   }
 })
開發者ID:,項目名稱:,代碼行數:7,代碼來源:

示例3:

		const toggleWin = (): void => {
			if (win.isVisible()) {
				win.hide();
			} else {
				win.show();
			}
		};
開發者ID:kusamakura,項目名稱:caprine,代碼行數:7,代碼來源:tray.ts

示例4:

  win.on("close", event => {
    if (process.platform === "win32" && !isRestarting) {
      event.preventDefault();

      if (win != null) {
        win.hide();
      }
    }
  });
開發者ID:stargeizer,項目名稱:noia-node-gui,代碼行數:9,代碼來源:main.ts

示例5: t

  nativeWindow.on("close", (e: any) => {
    const rs = store.getState();
    if (wind === "root") {
      const prefs =
        rs.preferences || ({ closeToTray: true } as PreferencesState);

      let { closeToTray } = prefs;
      if (rs.system.macos) {
        closeToTray = true;
      }
      if (env.integrationTests) {
        // always let app close in testing
        closeToTray = false;
      }

      if (store.getState().system.quitting) {
        logger.debug("On window.close: quitting, letting it close");
        return;
      }
      if (closeToTray) {
        logger.debug("On window.close: close to tray enabled");
      } else {
        logger.debug("On window.close: close to tray disabled, quitting!");
        process.nextTick(() => {
          store.dispatch(actions.quit({}));
        });
        return;
      }

      // hide, never destroy
      e.preventDefault();
      nativeWindow.hide();

      if (!prefs.gotMinimizeNotification && !store.getState().system.macos) {
        store.dispatch(
          actions.updatePreferences({
            gotMinimizeNotification: true,
          })
        );

        const i18n = store.getState().i18n;
        store.dispatch(
          actions.notify({
            title: t(i18n, ["notification.see_you_soon.title"]),
            body: t(i18n, ["notification.see_you_soon.message"]),
          })
        );
      }
    } else {
      store.dispatch(actions.windClosed({ wind }));
    }
  });
開發者ID:itchio,項目名稱:itch,代碼行數:52,代碼來源:winds.ts

示例6: 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");
 });
開發者ID:edoren,項目名稱:ChatClient,代碼行數:22,代碼來源:index.ts

示例7:

  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();
  });
開發者ID:wireapp,項目名稱:wire-desktop,代碼行數:15,代碼來源:main.ts

示例8: function

 click: function() {
   mainWindow.hide();
 }
開發者ID:gencebay,項目名稱:banoty,代碼行數:3,代碼來源:main.ts


注:本文中的electron.BrowserWindow.hide方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。