diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 78413968..7d85fa35 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -73,6 +73,7 @@ "term.viewAs": "View As", "term.viewAs.coverArt": "Cover Art", "term.viewAs.list": "List", + "term.dynamic": "Dynamic", "term.size": "Size", "term.size.normal": "Normal", "term.size.compact": "Compact", @@ -391,6 +392,11 @@ "settings.header.visual.theme.github.page": "Themes from GitHub", "settings.option.visual.theme.github.install.confirm": "Are you sure you want to install {{ repo }}?", "settings.prompt.visual.theme.github.URL": "Enter the URL of the theme you want to install", + "settings.prompt.visual.theme.uninstallTheme": "Are you sure you want to uninstall {{ theme }}?", + "settings.option.visual.theme.checkForUpdates": "Check for updates", + "settings.option.visual.theme.manageStyles": "Manage Styles", + "settings.option.visual.theme.uninstall": "Uninstall", + "settings.option.visual.theme.viewInfo": "View Info", "settings.notyf.visual.theme.install.success": "Theme installed successfully", "settings.notyf.visual.theme.install.error": "Theme installation failed", "settings.header.visual.plugin": "Plugin", diff --git a/src/i18n/source/en_US.json b/src/i18n/source/en_US.json index 71d7a3d8..7d85fa35 100644 --- a/src/i18n/source/en_US.json +++ b/src/i18n/source/en_US.json @@ -392,6 +392,11 @@ "settings.header.visual.theme.github.page": "Themes from GitHub", "settings.option.visual.theme.github.install.confirm": "Are you sure you want to install {{ repo }}?", "settings.prompt.visual.theme.github.URL": "Enter the URL of the theme you want to install", + "settings.prompt.visual.theme.uninstallTheme": "Are you sure you want to uninstall {{ theme }}?", + "settings.option.visual.theme.checkForUpdates": "Check for updates", + "settings.option.visual.theme.manageStyles": "Manage Styles", + "settings.option.visual.theme.uninstall": "Uninstall", + "settings.option.visual.theme.viewInfo": "View Info", "settings.notyf.visual.theme.install.success": "Theme installed successfully", "settings.notyf.visual.theme.install.error": "Theme installation failed", "settings.header.visual.plugin": "Plugin", diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index b920b66e..790b662f 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -715,6 +715,15 @@ export class BrowserWindow { // validate the path is in the themes directory try { if (path.startsWith(themesDir)) { + // get last dir in path, can be either / or \ and may have a trailing slash + const themeName = path.split(/[\\\/]/).pop() + if(themeName == "Themes" || themeName == "themes") { + BrowserWindow.win.webContents.send("theme-uninstalled", { + path: path, + status: 3 + }); + return + } // if path is directory, delete it if (lstatSync(path).isDirectory()) { await rmdirSync(path, { recursive: true }); diff --git a/src/renderer/less/pages.less b/src/renderer/less/pages.less index 6325faa1..652574a6 100644 --- a/src/renderer/less/pages.less +++ b/src/renderer/less/pages.less @@ -1180,6 +1180,23 @@ align-items: center; } + .handle { + height: 100%; + display: flex; + justify-content: center; + align-items: center; + } + + .list-group-item { + + &:hover { + cursor: grab; + } + &:active { + cursor: grabbing; + } + } + .removeItem { border : 0px; background : transparent; diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 12e37e89..e957839d 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -596,9 +596,7 @@ const app = new Vue({ }, async init() { let self = this - if (this.cfg.visual.theme != "default.less" && this.cfg.visual.theme != "") { - this.setTheme(this.cfg.visual.theme) - } + if (this.cfg.visual.styles.length != 0) { await this.reloadStyles() } diff --git a/src/renderer/views/pages/installed-themes.ejs b/src/renderer/views/pages/installed-themes.ejs index 5a23eb05..007e98ee 100644 --- a/src/renderer/views/pages/installed-themes.ejs +++ b/src/renderer/views/pages/installed-themes.ejs @@ -4,19 +4,25 @@

- Manage Styles + {{ $root.getLz("settings.option.visual.theme.manageStyles") }}

-
+
+ +
+
+ +
+
-
- -
+
@@ -61,6 +67,9 @@ + +
+
{{getThemeName(theme)}} @@ -202,19 +211,27 @@ let menu = { items: { "uninstall": { - name: "Uninstall", + name: app.getLz("settings.option.visual.theme.uninstall"), disabled: true, action: () => { - console.debug(theme) - ipcRenderer.once("theme-uninstalled", (event, args) => { - console.debug(event, args) - self.getThemesList() + bootbox.confirm(app.stringTemplateParser(app.getLz("settings.prompt.visual.theme.uninstallTheme"), { + theme: theme.name ?? theme.file + }), (res) => { + if (res) { + console.debug(theme) + ipcRenderer.once("theme-uninstalled", (event, args) => { + console.debug(event, args) + self.getThemesList() + }) + ipcRenderer.invoke("uninstall-theme", theme.path) + } }) - ipcRenderer.invoke("uninstall-theme", theme.path) + } }, "viewInfo": { - name: "View Info", + name: app.getLz("settings.option.visual.theme.viewInfo"), + disabled: true, action: () => { } diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs index 69c76380..8e9bc841 100644 --- a/src/renderer/views/pages/settings.ejs +++ b/src/renderer/views/pages/settings.ejs @@ -480,20 +480,8 @@ {{$root.getLz('settings.header.visual.theme')}}
- -
@@ -1216,19 +1204,6 @@ - -
- -
- Style Editor
- Mix and match various theme components to get Cider looking exactly how you - want. -
-
- -
-
-
{{$root.getLz('settings.option.experimental.unknownPlugin')}} diff --git a/src/renderer/views/pages/themes-github.ejs b/src/renderer/views/pages/themes-github.ejs index 1c67defa..2eda6cf0 100644 --- a/src/renderer/views/pages/themes-github.ejs +++ b/src/renderer/views/pages/themes-github.ejs @@ -5,17 +5,14 @@

{{$root.getLz('settings.header.visual.theme.github.page')}}

-
- +
+
-
@@ -106,7 +103,6 @@ this.themes = ipcRenderer.sendSync("get-themes") this.getRepos(); this.getInstalledThemes(); - app.checkForThemeUpdates() }, methods: { openThemesFolder() {