From 1da9ca40b55c22b4522af594dfd33ca00f318901 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Wed, 17 May 2023 09:39:23 +0800 Subject: [PATCH] fixup systemTray can't recoginize .ico file --- bin/builders/common.ts | 2 +- dist/cli.js | 4 +++- script/sd-linux-x86_64 | Bin 3 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 script/sd-linux-x86_64 diff --git a/bin/builders/common.ts b/bin/builders/common.ts index 93fd3ce..369addd 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -243,7 +243,7 @@ export async function mergeTauriConfig( if (icon_exists) { // 需要判断图标格式,默认只支持ico和png两种 let iconExt = path.extname(systemTrayIcon).toLowerCase(); - if (iconExt == ".png" || iconExt == ".icon") { + if (iconExt == ".png" || iconExt == ".ico") { useDefaultIcon = false; const trayIcoPath = path.join(npmDirectory, `src-tauri/png/${name.toLowerCase()}${iconExt}`); tauriConf.tauri.systemTray.iconPath = `png/${name.toLowerCase()}${iconExt}`; diff --git a/dist/cli.js b/dist/cli.js index 3034b04..b8379fd 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -34,6 +34,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ +/* global Reflect, Promise */ + function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -1837,7 +1839,7 @@ function mergeTauriConfig(url, options, tauriConf) { if (icon_exists) { // 需要判断图标格式,默认只支持ico和png两种 let iconExt = path.extname(systemTrayIcon).toLowerCase(); - if (iconExt == ".png" || iconExt == ".icon") { + if (iconExt == ".png" || iconExt == ".ico") { useDefaultIcon = false; const trayIcoPath = path.join(npmDirectory, `src-tauri/png/${name.toLowerCase()}${iconExt}`); tauriConf.tauri.systemTray.iconPath = `png/${name.toLowerCase()}${iconExt}`; diff --git a/script/sd-linux-x86_64 b/script/sd-linux-x86_64 old mode 100644 new mode 100755