-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tray and window management #54
base: master
Are you sure you want to change the base?
Tray and window management #54
Conversation
Reopening the last window can now be done by double clicking the tray icon.
The latest addition, may or may not require some additional testing to ensure that the functionality is robust enough, but it seems to be working just fine. |
module.exports = function createTrayMenu (hideAllWindowsCallback, showAllWindowsCallback) { | ||
let tray = null | ||
app.whenReady().then(() => { | ||
tray = new Tray(path.join(__dirname, '..', 'build','icon.png')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in macos tray icon don't fit to panel and has 100% size
can you resize icon to 20x20 (and 40x40 for @2) and use it in tray instance?
https://www.electronjs.org/docs/api/native-image#high-resolution-image
document.title = "Google Keep - " | ||
+ document.querySelector('div.gb_sb').textContent | ||
+ " - " | ||
+ document.querySelector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app will crash if this selector becomes empty
}) | ||
} | ||
|
||
app.on('window-all-closed', e => e.preventDefault()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how i can close the app? cmd+q closes only window the same way as quit button in tray menu
const lastWindowState = config.get('lastWindowState') | ||
module.exports = { | ||
createMainWindow: function (handleResize, handleClose, handleClosed) { | ||
return module.exports.createMainWindowWithUrl(handleResize, handleClose, handleClosed, 'https://keep.google.com') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please declare all functions at the top of this module and export them at the end together. to prevent call module.exports.createMainWindowWithUrl
Exactly what the title says.
Adds the tray support requested in issue #27 as well as some relevant window management.
The app can now run entirely in the tray, getting it out of the way when not actively in use.
Semi dependent on PR #53, as the tray icon will not work in builds, due to the bug fixed by that PR.