🎨 add open icon

This commit is contained in:
Vanessa 2023-10-23 00:25:36 +08:00
parent ced5995d2e
commit 88f9318e0b
8 changed files with 17 additions and 2 deletions

View file

@ -1,5 +1,8 @@
document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="iconOpen" viewBox="0 0 32 32">
<path d="M1 27.979l22.693-22.693h-14.121v-4.286h21.429v21.429h-4.286v-14.121l-22.693 22.693-3.021-3.021z"></path>
</symbol>
<symbol id="iconKey" viewBox="0 0 32 32">
<path d="M19.602 1c-6.295 0-11.398 5.103-11.398 11.398 0 2.636 0.896 5.062 2.396 6.993l-1.541 1.541-2.336-2.336c-0.055-0.054-0.131-0.087-0.214-0.087s-0.159 0.033-0.214 0.087l-1.492 1.492c-0.054 0.055-0.087 0.131-0.087 0.214s0.033 0.159 0.087 0.214l2.336 2.336-1.683 1.683-2.336-2.336c-0.055-0.054-0.131-0.087-0.214-0.087s-0.159 0.033-0.214 0.087l-1.492 1.492c-0.054 0.055-0.087 0.131-0.087 0.214s0.033 0.159 0.087 0.214l2.336 2.336-2.448 2.448c-0.054 0.054-0.087 0.129-0.087 0.212s0.033 0.157 0.087 0.212l1.586 1.586c0.116 0.116 0.307 0.116 0.424 0l9.509-9.509c1.909 1.492 4.343 2.392 6.987 2.392 0.003 0 0.006 0 0.010 0h-0c6.295 0 11.398-5.103 11.398-11.398s-5.103-11.398-11.398-11.398zM25.646 18.442c-1.612 1.616-3.761 2.505-6.044 2.505s-4.432-0.889-6.044-2.505c-1.616-1.612-2.505-3.761-2.505-6.044s0.889-4.432 2.505-6.044c1.612-1.616 3.761-2.505 6.044-2.505s4.432 0.889 6.044 2.505c1.616 1.612 2.505 3.761 2.505 6.044s-0.889 4.432-2.505 6.044z"></path>
</symbol>

View file

@ -2,5 +2,5 @@
"name": "ant",
"author": "Vanessa",
"url": "https://github.com/Vanessa219",
"version": "1.25.0"
"version": "1.26.0"
}

View file

@ -28,6 +28,12 @@
<body>
<h2>SiYuan</h2>
<div class="fn__clear">
<div>
<svg>
<use xlink:href="#iconOpen"></use>
</svg>
iconOpen
</div>
<div>
<svg>
<use xlink:href="#iconKey"></use>

View file

@ -1,5 +1,8 @@
document.body.insertAdjacentHTML('afterbegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="iconOpen" viewBox="0 0 32 32">
<path d="M1 27.979l22.693-22.693h-14.121v-4.286h21.429v21.429h-4.286v-14.121l-22.693 22.693-3.021-3.021z"></path>
</symbol>
<symbol id="iconKey" viewBox="0 0 32 32">
<path d="M9.561 23.727q-3.22 0-5.473-2.254t-2.254-5.474 2.254-5.473 5.473-2.254q2.125 0 3.896 1.063t2.801 2.801h13.909v7.727h-2.576v3.864h-7.727v-3.864h-3.606q-1.030 1.739-2.801 2.801t-3.896 1.063zM9.561 21.151q2.125 0 3.413-1.304t1.545-2.56h7.92v3.864h2.576v-3.864h2.576v-2.576h-13.072q-0.258-1.256-1.545-2.56t-3.413-1.304-3.638 1.513-1.513 3.638 1.513 3.638 3.638 1.513zM9.561 18.576q1.063 0 1.819-0.757t0.757-1.819-0.757-1.819-1.819-0.757-1.819 0.757-0.757 1.819 0.757 1.819 1.819 0.757z"></path>
</symbol>

View file

@ -2,5 +2,5 @@
"name": "material",
"author": "Vanessa",
"url": "https://github.com/Vanessa219",
"version": "1.25.0"
"version": "1.26.0"
}

View file

@ -746,6 +746,7 @@ export const openMenu = (app: App, src: string, onlyMenu: boolean, showAccelerat
}
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.openBy,
icon: "iconOpen",
submenu
}).element);
};

View file

@ -1343,6 +1343,7 @@ export const videoMenu = (protyle: IProtyle, nodeElement: Element, type: string)
if (VideoSrc) {
subMenus.push({
label: window.siyuan.languages.openBy,
icon: "iconOpen",
submenu: openMenu(protyle.app, VideoSrc, true, false) as IMenu[]
});
}

View file

@ -127,6 +127,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
/// #endif
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.openBy,
icon: "iconOpen",
submenu: openSubmenus,
}).element);
/// #endif