Skip to content

Commit

Permalink
✨ 添加设置页面小图标
Browse files Browse the repository at this point in the history
  • Loading branch information
MUKAPP committed Jan 27, 2024
1 parent a03fb2c commit f88c98a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ export const onSettingWindowCreated = async view => {

view.innerHTML = await (await fetch(html_file_path)).text();

// 添加插件图标
document.querySelectorAll(".nav-item.liteloader").forEach((node) => {
// 本插件图标
if (node.textContent === "DeepL") {
node.querySelector(".q-icon").innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m584.922-222.001-38.231 103.154q-3.231 8.307-10.731 13.576-7.5 5.27-16.807 5.27-15.384 0-24.615-12.654-9.231-12.654-3.154-27.653l155.462-401.231q3.846-8.307 11.154-13.384Q665.307-560 674.23-560h22.307q8.923 0 16.23 5.077 7.308 5.077 11.154 13.384l155.462 401.846q6.077 14.384-2.846 27.038t-24.307 12.654q-9.923 0-17.115-5.27-7.193-5.269-11.039-14.192l-38.231-102.538H584.922ZM359.307-416.386 181.461-238.77q-8.307 8.692-20.576 9-12.269.307-21.577-9-8.692-8.692-8.692-21.076 0-12.385 8.692-21.077l177.847-178.231q-34.616-35-65.808-83.077-31.193-48.077-51.346-97.769h63.614q17.307 36.307 42.115 72.616 24.808 36.308 53.577 66.077 42.617-43 80.617-104.424 38-61.423 53.692-114.269H97.694q-12.77 0-21.385-8.615-8.615-8.615-8.615-21.384t8.615-21.384q8.616-8.616 21.385-8.616H330v-34.615q0-12.768 8.615-21.384 8.615-8.615 21.384-8.615t21.384 8.615q8.615 8.616 8.615 21.384v34.615h232.307q12.769 0 21.384 8.616 8.616 8.615 8.616 21.384t-8.616 21.384Q635.075-720 622.306-720h-67.922q-19.462 67.384-62.038 140.884-42.577 73.5-90.886 121.193l98.693 101.077-22.692 61.614-118.154-121.154Zm244.845 141.309h162.463l-81.231-218.232-81.232 218.232Z"/></svg>`;
}
});

// 获取设置
const settings = await deepl_plugin.getSettings();

Expand Down

0 comments on commit f88c98a

Please sign in to comment.