mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 11:42:19 +08:00
support svg icon
This commit is contained in:
parent
801d03c374
commit
772ea50311
|
@ -183,9 +183,11 @@ export function registerIpcMainHandlers(): void {
|
|||
ipcMain.handle('setNativeTheme', (_e, theme) => {
|
||||
setNativeTheme(theme)
|
||||
})
|
||||
ipcMain.handle('setTitleBarOverlay', (_e, overlay) => {
|
||||
mainWindow?.setTitleBarOverlay(overlay)
|
||||
})
|
||||
ipcMain.handle('setTitleBarOverlay', (_e, overlay) =>
|
||||
ipcErrorWrapper(async (overlay): Promise<void> => {
|
||||
mainWindow?.setTitleBarOverlay(overlay)
|
||||
})(overlay)
|
||||
)
|
||||
ipcMain.handle('setAlwaysOnTop', (_e, alwaysOnTop) => {
|
||||
mainWindow?.setAlwaysOnTop(alwaysOnTop)
|
||||
})
|
||||
|
|
|
@ -195,6 +195,7 @@ const Proxies: React.FC = () => {
|
|||
className="bg-transparent mr-2"
|
||||
size="sm"
|
||||
onLoad={() => {
|
||||
if (!groups[index].icon.startsWith('http')) return
|
||||
const img = new Image()
|
||||
img.crossOrigin = 'anonymous'
|
||||
img.onload = (): void => {
|
||||
|
@ -209,7 +210,13 @@ const Proxies: React.FC = () => {
|
|||
img.src = groups[index].icon
|
||||
}}
|
||||
radius="sm"
|
||||
src={localStorage.getItem(groups[index].icon) || groups[index].icon}
|
||||
src={
|
||||
groups[index].icon.startsWith('http')
|
||||
? localStorage.getItem(groups[index].icon) || groups[index].icon
|
||||
: groups[index].icon.startsWith('<svg')
|
||||
? `data:image/svg+xml;utf8,${groups[index].icon}`
|
||||
: groups[index].icon
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
<div className="text-ellipsis overflow-hidden whitespace-nowrap">
|
||||
|
|
Loading…
Reference in New Issue
Block a user