mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Add custom themes
This commit is contained in:
@@ -76,6 +76,31 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async getCustomTheme() {
|
||||
const result = await window.electron.invoke.showOpenDialog({
|
||||
title: 'Choose custom theme',
|
||||
defaultPath: this.settingsService.libraryDirectory || '',
|
||||
properties: ['openFile'],
|
||||
filters: [
|
||||
{ name: "Themes", extensions: ["json"] },
|
||||
],
|
||||
})
|
||||
|
||||
if (result.canceled === false) {
|
||||
const newThemeColors = await window.electron.invoke.getThemeColors(result.filePaths[0])
|
||||
|
||||
if (newThemeColors) {
|
||||
this.settingsService.customTheme = newThemeColors
|
||||
} else {
|
||||
alert(`ERROR: ${result.filePaths[0]} was not a valid JSON file.`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clearCustomTheme() {
|
||||
this.settingsService.customTheme = null
|
||||
}
|
||||
|
||||
openLibraryDirectory() {
|
||||
if (this.settingsService.libraryDirectory) {
|
||||
window.electron.emit.showFolder(this.settingsService.libraryDirectory)
|
||||
|
||||
Reference in New Issue
Block a user