mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 11:01:45 +00:00
feat(in-app-menu): add an option to hide the window controls (#1335)
This commit is contained in:
22
src/plugins/in-app-menu/menu.ts
Normal file
22
src/plugins/in-app-menu/menu.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { BrowserWindow } from 'electron';
|
||||
|
||||
import is from 'electron-is';
|
||||
|
||||
import { setMenuOptions } from '../../config/plugins';
|
||||
|
||||
import type { MenuTemplate } from '../../menu';
|
||||
import type { ConfigType } from '../../config/dynamic';
|
||||
|
||||
export default (_: BrowserWindow, config: ConfigType<'in-app-menu'>): MenuTemplate => [
|
||||
...(is.linux() ? [
|
||||
{
|
||||
label: 'Hide DOM Window Controls',
|
||||
type: 'checkbox',
|
||||
checked: config.hideDOMWindowControls,
|
||||
click(item) {
|
||||
config.hideDOMWindowControls = item.checked;
|
||||
setMenuOptions('in-app-menu', config);
|
||||
}
|
||||
}
|
||||
] : []) satisfies Electron.MenuItemConstructorOptions[],
|
||||
];
|
||||
Reference in New Issue
Block a user