Skip to content

Commit

Permalink
feat: custom electron background color
Browse files Browse the repository at this point in the history
  • Loading branch information
subframe7536 committed Oct 18, 2024
1 parent 1140c11 commit 9069617
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/manager/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const entry = 'backgroundColor:r.getBackgroundColor()'

export class MainFileManager extends BaseFileManager {
patch(_fontChanged: boolean, content: () => string): Promisable<string | undefined> {
return content().replace(entry, `${JSON.stringify(config.electron).slice(1, -1)},${entry}`)
const backgroundColor = config.electron.backgroundColor || 'r.getBackgroundColor()'
return content().replace(
entry,
`${JSON.stringify(config.electron).slice(1, -1)},backgroundColor:${backgroundColor}`,
)
}
}

0 comments on commit 9069617

Please sign in to comment.