1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-04 05:10:05 +02:00

fix search window

This commit is contained in:
s2
2019-06-06 15:56:42 +02:00
parent c5f9b551ab
commit 1313cff86a
21 changed files with 1297 additions and 0 deletions

47
app/node_modules/electron-find/example/main.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
const electron = require('electron')
const { app, BrowserWindow, globalShortcut } = electron
const path = require('path')
let win
const winURL = 'file://' + path.normalize(`${__dirname}/index.html`)
function createWindow () {
win = new BrowserWindow({
width: 1280,
height: 1040,
center: false,
webPreferences: {
nodeIntegration: true,
plugins: true,
}
})
win.loadURL(winURL)
//win.webContents.openDevTools()
win.on('closed', () => {
win = null
})
win.on('focus', () => {
globalShortcut.register('CommandOrControl+F', function () {
if (win && win.webContents) {
win.webContents.send('on-find', '')
}
})
})
win.on('blur', () => {
globalShortcut.unregister('CommandOrControl+F')
})
}
app.on('ready', createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
globalShortcut.unregister('CommandOrControl+F')
})
app.on('activate', () => {
if (win === null) createWindow()
})