Add 2 more config options

refreshOnPlayPause: false
trayControls: true,
This commit is contained in:
Araxeus
2023-01-09 23:46:44 +02:00
parent 1c5d61854e
commit bc5023c360
5 changed files with 88 additions and 21 deletions

View File

@ -25,6 +25,30 @@ module.exports = (_win, options) => [
// doesn't update until restart
click: (item) => config.setAndMaybeRestart("interactive", item.checked),
},
{
// submenu with settings for interactive notifications (name shouldn't be too long)
label: "Interactive Settings",
submenu: [
{
label: "Open/Close on tray click",
type: "checkbox",
checked: options.trayControls,
click: (item) => config.set("trayControls", item.checked),
},
{
label: "Hide Button Text",
type: "checkbox",
checked: options.hideButtonText,
click: (item) => config.set("hideButtonText", item.checked),
},
{
label: "Refresh on Play/Pause",
type: "checkbox",
checked: options.refreshOnPlayPause,
click: (item) => config.set("refreshOnPlayPause", item.checked),
}
]
},
{
label: "Toast Style",
submenu: getToastStyleMenuItems(options)
@ -40,20 +64,11 @@ module.exports = (_win, options) => [
];
function getToastStyleMenuItems(options) {
const arr = new Array(Object.keys(ToastStyles).length + 2);
arr[0] = {
label: "Hide Button Text",
type: "checkbox",
checked: options.hideButtonText,
click: (item) => config.set("hideButtonText", item.checked),
}
arr[1] = { type: "separator" };
const arr = new Array(Object.keys(ToastStyles).length);
// ToastStyles index starts from 1
for (const [name, index] of Object.entries(ToastStyles)) {
arr[index + 1] = {
arr[index - 1] = {
label: snakeToCamel(name),
type: "radio",
checked: options.style === index,