mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge branch 'master' of github.com:BoostIO/Boostnote
This commit is contained in:
@@ -11,7 +11,7 @@ const { clipboard } = electron
|
||||
const path = require('path')
|
||||
|
||||
function notify (title, options) {
|
||||
if (process.platform === 'win32') {
|
||||
if (global.process.platform === 'win32') {
|
||||
options.icon = path.join('file://', global.__dirname, '../../resources/app.png')
|
||||
}
|
||||
return new window.Notification(title, options)
|
||||
|
||||
@@ -15,11 +15,12 @@ const { remote } = electron
|
||||
const { Menu } = remote
|
||||
|
||||
function hideFinder () {
|
||||
if (process.platform === 'win32') {
|
||||
remote.getCurrentWindow().minimize()
|
||||
return
|
||||
let finderWindow = remote.getCurrentWindow()
|
||||
if (global.process.platform === 'win32') {
|
||||
finderWindow.blur()
|
||||
finderWindow.hide()
|
||||
}
|
||||
if (process.platform === 'darwin') {
|
||||
if (global.process.platform === 'darwin') {
|
||||
Menu.sendActionToFirstResponder('hide:')
|
||||
}
|
||||
remote.getCurrentWindow().hide()
|
||||
@@ -48,6 +49,7 @@ class FinderMain extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
this.refs.search.focus()
|
||||
window.addEventListener('focus', this.focusHandler)
|
||||
window.addEventListener('blur', this.blurHandler)
|
||||
}
|
||||
|
||||
@@ -30,12 +30,21 @@ function toggleFinder () {
|
||||
finderWindow.show()
|
||||
}
|
||||
} else {
|
||||
if (!finderWindow.isMinimized()) {
|
||||
finderWindow.minimize()
|
||||
if (finderWindow.isVisible()) {
|
||||
finderWindow.blur()
|
||||
finderWindow.hide()
|
||||
} else {
|
||||
nodeIpc.of.node.emit('request-data')
|
||||
finderWindow.restore()
|
||||
finderWindow.show()
|
||||
finderWindow.focus()
|
||||
}
|
||||
// if (!finderWindow.isMinimized()) {
|
||||
// finderWindow.minimize()
|
||||
// } else {
|
||||
// nodeIpc.of.node.emit('request-data')
|
||||
// finderWindow.restore()
|
||||
// finderWindow.focus()
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user