How to use the electron-util.is.macos function in electron-util

To help you get started, we’ve selected a few electron-util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sarthology / caligator / index.js View on Github external
app.on('window-all-closed', () => {
	if (!is.macos) {
		app.quit();
	}
});
github sarthology / caligator / menu.js View on Github external
---

${debugInfo()}`;

			openNewGitHubIssue({
				user: 'sarthology',
				repo: 'caligator',
				body
			});
		}
	}
];

if (!is.macos) {
	helpSubmenu.push(
		{
			type: 'separator'
		},
		aboutMenuItem({
			icon: path.join(__dirname, 'static', 'icon.png'),
			text: 'Created by Sarthak Sharma'
		})
	);
}

const debugSubmenu = [
	{
		label: 'Show Settings',
		click() {
			config.openInEditor();
github nano-wallet-company / nano-wallet-desktop / ember-electron / window.js View on Github external
window.on('close', event => {
    if (is.macos && !global.isQuitting && !global.isUpdating) {
      event.preventDefault();
      window.hide();
    }
  });
github sindresorhus / caprine / source / menu.ts View on Github external
---

${debugInfo()}`;

				openNewGitHubIssue({
					user: 'sindresorhus',
					repo: 'caprine',
					body
				});
			}
		}
	];

	if (!is.macos) {
		helpSubmenu.push(
			{
				type: 'separator'
			},
			aboutMenuItem({
				icon: caprineIconPath,
				text: 'Created by Sindre Sorhus'
			})
		);
	}

	const debugSubmenu: MenuItemConstructorOptions[] = [
		{
			label: 'Show Settings',
			click() {
				config.openInEditor();
github sindresorhus / caprine / source / menu.ts View on Github external
}
		},
		{
			label: 'Show Tray Icon',
			type: 'checkbox',
			enabled: is.linux || is.windows,
			checked: config.get('showTrayIcon'),
			click() {
				config.set('showTrayIcon', !config.get('showTrayIcon'));
				sendAction('toggle-tray-icon');
			}
		},
		{
			label: 'Launch Minimized',
			type: 'checkbox',
			visible: !is.macos,
			checked: config.get('launchMinimized'),
			click() {
				config.set('launchMinimized', !config.get('launchMinimized'));
				sendAction('toggle-tray-icon');
			}
		},
		{
			label: 'Quit on Window Close',
			type: 'checkbox',
			checked: config.get('quitOnWindowClose'),
			click() {
				config.set('quitOnWindowClose', !config.get('quitOnWindowClose'));
			}
		},
		{
			type: 'separator'
github notable / notable / src / renderer / components / main / sidebar / toolbar.tsx View on Github external
const Toolbar = ({ isFullscreen }) => {

  if ( !is.macos || isFullscreen ) return null;

  return <div></div>;

};
github sindresorhus / caprine / source / tray.ts View on Github external
function getIconPath(hasUnreadMessages: boolean): string {
	const icon = is.macos ?
		getMacOSIconName(hasUnreadMessages) :
		getNonMacOSIconName(hasUnreadMessages);

	return path.join(__dirname, '..', `static/${icon}`);
}
github notable / notable / src / main / app.ts View on Github external
__windowAllClosed = () => {

    if ( is.macos ) return this.initMenu ();

    this.quit ();

  }
github sindresorhus / caprine / source / menu-bar-mode.ts View on Github external
export function setUpMenuBarMode(window: BrowserWindow): void {
	if (is.macos) {
		toggleMenuBarMode(window);
	} else if (config.get('showTrayIcon') && !config.get('quitOnWindowClose')) {
		tray.create(window);
	}
}
github LulumiProject / lulumi-browser / src / renderer / mainBrowserWindow / components / BrowserMainView / Tabs.vue View on Github external
windowId: {
      type: Number,
      required: true,
    },
  },
  components: {
    'awesome-icon': AwesomeIcon,
    'el-button': Button,
    'el-tooltip': Tooltip,
  },
})
export default class Tabs extends Vue {
  sortable: any;

  windowId: number;
  enableCustomButtons: boolean = !is.macos;

  get window(): Lulumi.Store.LulumiBrowserWindowProperty {
    return this.$store.getters.windows.find(window => window.id === this.windowId);
  }
  get currentTabIndex(): number {
    return this.$store.getters.currentTabIndexes[this.windowId];
  }
  get tabs(): Lulumi.Store.TabObject[] {
    return this.$store.getters.tabs.filter(tab => tab.windowId === this.windowId);
  }

  loadButton(id: string): string {
    return process.env.NODE_ENV !== 'production'
      ? `${path.join('static', 'icons', 'icons.svg')}#${id}`
      : fixPathForAsarUnpack(`${path.join(__static, 'icons', 'icons.svg')}#${id}`);
  }