diff --git a/client/src/modules/contentmanager.js b/client/src/modules/contentmanager.js index f89e7f94..ac0b33c3 100644 --- a/client/src/modules/contentmanager.js +++ b/client/src/modules/contentmanager.js @@ -225,6 +225,10 @@ export default class { setting.setContentPath(contentPath); } + for (let scheme of userConfig.config.schemes) { + scheme.setContentPath(contentPath); + } + Utils.deepfreeze(defaultConfig, object => object instanceof Combokeys); const configs = { diff --git a/client/src/structs/settings/settingsscheme.js b/client/src/structs/settings/settingsscheme.js index d0201660..5d8f03f3 100644 --- a/client/src/structs/settings/settingsscheme.js +++ b/client/src/structs/settings/settingsscheme.js @@ -32,6 +32,21 @@ export default class SettingsScheme { return this.args.icon_url; } + /** + * The path of the scheme's icon relative to the content path. + */ + get icon_path() { + return this.args.icon_path; + } + + /** + * The MIME type of the scheme's icon. + * This is only needed when using `icon_path` and the MIME type cannot be determined from the file contents. (Usually when using an SVG.) + */ + get icon_type() { + return this.args.icon_type; + } + /** * The scheme's name. */ @@ -53,6 +68,14 @@ export default class SettingsScheme { return this.args.settings || []; } + /** + * The path of the plugin/theme this scheme is part of. + * Use scheme.setContentPath to change. + */ + get path() { + return this.args.path; + } + /** * Checks if this scheme's values are currently applied to a set. * @param {SettingsSet} set The set to check @@ -89,4 +112,12 @@ export default class SettingsScheme { return set.merge(this); } + /** + * Sets the path of the plugin/theme this setting is part of. + * @param {String} contentPath The plugin/theme's directory path + */ + setContentPath(contentPath) { + this.args.path = contentPath; + } + } diff --git a/client/src/ui/components/bd/SettingsPanel.vue b/client/src/ui/components/bd/SettingsPanel.vue index d9576e91..9f3bd55b 100644 --- a/client/src/ui/components/bd/SettingsPanel.vue +++ b/client/src/ui/components/bd/SettingsPanel.vue @@ -12,13 +12,7 @@