mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 22:29:38 +00:00
Restructure; use DaisyUI
This commit is contained in:
46
src-electron/ipc/UtilHandlers.ipc.ts
Normal file
46
src-electron/ipc/UtilHandlers.ipc.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { app, dialog, OpenDialogOptions, shell } from 'electron'
|
||||
|
||||
import { mainWindow } from '../main'
|
||||
|
||||
/**
|
||||
* Opens `url` in the default browser.
|
||||
*/
|
||||
export function openUrl(url: string) {
|
||||
shell.openExternal(url)
|
||||
}
|
||||
|
||||
export function toggleDevTools() {
|
||||
mainWindow.webContents.toggleDevTools()
|
||||
}
|
||||
|
||||
export async function isMaximized() {
|
||||
return mainWindow.isMaximized()
|
||||
}
|
||||
|
||||
export function maximize() {
|
||||
mainWindow.maximize()
|
||||
}
|
||||
|
||||
export function minimize() {
|
||||
mainWindow.minimize()
|
||||
}
|
||||
|
||||
export function restore() {
|
||||
mainWindow.restore()
|
||||
}
|
||||
|
||||
export function quit() {
|
||||
app.quit()
|
||||
}
|
||||
|
||||
export function showOpenDialog(options: OpenDialogOptions) {
|
||||
return dialog.showOpenDialog(mainWindow, options)
|
||||
}
|
||||
|
||||
export function showFolder(folderPath: string) {
|
||||
shell.openPath(folderPath)
|
||||
}
|
||||
|
||||
export function showFile(filePath: string) {
|
||||
shell.showItemInFolder(filePath)
|
||||
}
|
||||
Reference in New Issue
Block a user