本文整理汇总了TypeScript中app.dock类的典型用法代码示例。如果您正苦于以下问题:TypeScript dock类的具体用法?TypeScript dock怎么用?TypeScript dock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dock类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
.on("focus", (): void => app.dock && app.dock.setBadge(""));
示例2: require
const app: Electron.App = require("app");
const browserWindowConstructor: typeof Electron.BrowserWindow = require("browser-window");
import {ipcMain, nativeImage} from "electron";
import menu from "./Menu";
let fixPath = require("fix-path");
let browserWindow: Electron.BrowserWindow = undefined;
// Fix the $PATH on OS X
fixPath();
if (app.dock) {
app.dock.setIcon(nativeImage.createFromPath("icon.png"));
}
app.on("open-file", (event: Event, file: string) => getMainWindow().webContents.send("change-working-directory", file))
.on("ready", getMainWindow)
.on("activate", getMainWindow)
.on("mainWindow-all-closed", () => process.platform === "darwin" || app.quit());
ipcMain.on("quit", app.quit);
function getMainWindow(): Electron.BrowserWindow {
const screen: Electron.Screen = require("screen");
const workAreaSize = screen.getPrimaryDisplay().workAreaSize;
if (!browserWindow) {
let options: Electron.BrowserWindowOptions = {
webPreferences: {
experimentalFeatures: true,
experimentalCanvasFeatures: true,