mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: add theme editor with Monaco and custom CSS injection
This commit is contained in:
parent
3e2d7a751c
commit
5a19e9fd12
23 changed files with 516 additions and 20 deletions
|
@ -342,4 +342,19 @@ contextBridge.exposeInMainWorld("electron", {
|
|||
deleteAllCustomThemes: () => ipcRenderer.invoke("deleteAllCustomThemes"),
|
||||
deleteCustomTheme: (themeId: string) =>
|
||||
ipcRenderer.invoke("deleteCustomTheme", themeId),
|
||||
updateCustomTheme: (themeId: string, theme: Theme) =>
|
||||
ipcRenderer.invoke("updateCustomTheme", themeId, theme),
|
||||
getCustomThemeById: (themeId: string) =>
|
||||
ipcRenderer.invoke("getCustomThemeById", themeId),
|
||||
getActiveCustomTheme: () => ipcRenderer.invoke("getActiveCustomTheme"),
|
||||
|
||||
/* Editor */
|
||||
openEditorWindow: (themeId: string) => ipcRenderer.invoke("openEditorWindow", themeId),
|
||||
injectCSS: (cssString: string) =>
|
||||
ipcRenderer.invoke("injectCSS", cssString),
|
||||
onCssInjected: (cb: (cssString: string) => void) => {
|
||||
const listener = (_event: Electron.IpcRendererEvent, cssString: string) => cb(cssString);
|
||||
ipcRenderer.on("css-injected", listener);
|
||||
return () => ipcRenderer.removeListener("css-injected", listener);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue