Skip to content

Commit

Permalink
chore: Hide dock icon when window is minimized to tray(macOS only).
Browse files Browse the repository at this point in the history
Signed-off-by: The1111mp <The1111mp@outlook.com>
  • Loading branch information
1111mp committed Dec 4, 2023
1 parent 097b322 commit de90dcb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ const createWindow = async (code?: number) => {
? '#000000'
: '#ffffff'
: setting.theme === Themes.Dark
? '#000000'
: '#ffffff',
? '#000000'
: '#ffffff',
webPreferences: {
preload: app.isPackaged
? join(__dirname, 'preload.js')
Expand Down Expand Up @@ -182,6 +182,10 @@ const createWindow = async (code?: number) => {
*/

app.on('window-all-closed', () => {
if (setting.closer == Closer.Minimize) {
platform !== 'win32' && app.dock.hide();
}

if (setting.closer === Closer.Close) {
app.quit();
}
Expand Down

0 comments on commit de90dcb

Please sign in to comment.