mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 12:42:06 +00:00
fix(macos): fix some plugins not working in macos
This commit is contained in:
@ -11,14 +11,17 @@ function $<E extends Element = Element>(selector: string) {
|
|||||||
return document.querySelector<E>(selector);
|
return document.querySelector<E>(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isMacOS = navigator.userAgent.includes('Macintosh');
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const titleBar = document.createElement('title-bar');
|
const titleBar = document.createElement('title-bar');
|
||||||
const navBar = document.querySelector<HTMLDivElement>('#nav-bar-background');
|
const navBar = document.querySelector<HTMLDivElement>('#nav-bar-background');
|
||||||
|
if (isMacOS) titleBar.style.setProperty('--offset-left', '70px');
|
||||||
|
|
||||||
const logo = ElementFromFile(path.join(__dirname, '..' , '..' , 'assets', 'youtube-music.svg'));
|
const logo = ElementFromFile(path.join(__dirname, '..' , '..' , 'assets', 'youtube-music.svg'));
|
||||||
logo.classList.add('title-bar-icon');
|
logo.classList.add('title-bar-icon');
|
||||||
|
|
||||||
titleBar.appendChild(logo);
|
if (!isMacOS) titleBar.appendChild(logo);
|
||||||
document.body.appendChild(titleBar);
|
document.body.appendChild(titleBar);
|
||||||
|
|
||||||
if (navBar) {
|
if (navBar) {
|
||||||
|
|||||||
@ -23,6 +23,7 @@ title-bar {
|
|||||||
color: #f1f1f1;
|
color: #f1f1f1;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
|
padding-left: var(--offset-left, 12px);
|
||||||
background-color: var(--titlebar-background-color, #030303);
|
background-color: var(--titlebar-background-color, #030303);
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export default (win: BrowserWindow, options: ConfigType<'precise-volume'>): Menu
|
|||||||
{
|
{
|
||||||
label: 'Global Hotkeys',
|
label: 'Global Hotkeys',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
checked: Boolean(options.globalShortcuts.volumeUp) || Boolean(options.globalShortcuts.volumeDown),
|
checked: Boolean(options.globalShortcuts?.volumeUp ?? options.globalShortcuts?.volumeDown),
|
||||||
click: (item) => promptGlobalShortcuts(win, options, item),
|
click: (item) => promptGlobalShortcuts(win, options, item),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user