forked from qier222/YesPlayMusic
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request qier222#1818 from Revincx/revincx-pr
- Loading branch information
Showing
12 changed files
with
144 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* global __static */ | ||
import path from 'path'; | ||
import { app, nativeImage, Tray, Menu } from 'electron'; | ||
import { app, nativeImage, Tray, Menu, nativeTheme } from 'electron'; | ||
import { isLinux } from '@/utils/platform'; | ||
|
||
function createMenuTemplate(win) { | ||
|
@@ -197,8 +197,11 @@ class YPMTrayWindowsImpl { | |
} | ||
|
||
export function createTray(win, eventEmitter) { | ||
// 感觉图标颜色应该不属于界面主题范畴,只需要跟随系统主题 | ||
let iconTheme = nativeTheme.shouldUseDarkColors ? 'light' : 'dark'; | ||
|
||
let icon = nativeImage | ||
.createFromPath(path.join(__static, 'img/icons/[email protected]')) | ||
.createFromPath(path.join(__static, `img/icons/menu-${iconTheme}@88.png`)) | ||
.resize({ | ||
height: 20, | ||
width: 20, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters