mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Feat: Add theme folder access functionality in UI
This commit is contained in:
@@ -22,6 +22,10 @@ const FEATURE_WHITELIST = new Set([
|
|||||||
|
|
||||||
const configFolderPath = featuresPath;
|
const configFolderPath = featuresPath;
|
||||||
|
|
||||||
|
const themeFolderPath = config.localMode
|
||||||
|
? path.join(__dirname, "..", "theme")
|
||||||
|
: path.join(process.resourcesPath, "theme");
|
||||||
|
|
||||||
function registerIpcHandlers(getMainWindow) {
|
function registerIpcHandlers(getMainWindow) {
|
||||||
|
|
||||||
// Infos générales
|
// Infos générales
|
||||||
@@ -75,6 +79,8 @@ function registerIpcHandlers(getMainWindow) {
|
|||||||
);
|
);
|
||||||
ipcMain.on("open-config", () => shell.openPath(configFolderPath));
|
ipcMain.on("open-config", () => shell.openPath(configFolderPath));
|
||||||
|
|
||||||
|
ipcMain.on("open-theme", () => shell.openPath(themeFolderPath));
|
||||||
|
|
||||||
ipcMain.handle("get-themes", () => getThemes());
|
ipcMain.handle("get-themes", () => getThemes());
|
||||||
|
|
||||||
// Modification des features
|
// Modification des features
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ contextBridge.exposeInMainWorld("topbarAPI", {
|
|||||||
openDevTools: () => ipcRenderer.send("open-devtools"),
|
openDevTools: () => ipcRenderer.send("open-devtools"),
|
||||||
openLogs: () => ipcRenderer.send("open-logs"),
|
openLogs: () => ipcRenderer.send("open-logs"),
|
||||||
openWebsite: () => ipcRenderer.send("open-website"),
|
openWebsite: () => ipcRenderer.send("open-website"),
|
||||||
|
openTheme: () => ipcRenderer.send("open-theme"),
|
||||||
openWiki: () => ipcRenderer.send("open-wiki"),
|
openWiki: () => ipcRenderer.send("open-wiki"),
|
||||||
openConfig: () => ipcRenderer.send("open-config")
|
openConfig: () => ipcRenderer.send("open-config")
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<button id="logs-btn" title="Logs">Logs</button>
|
<button id="logs-btn" title="Logs">Logs</button>
|
||||||
<button id="website-btn" title="Website">Website</button>
|
<button id="website-btn" title="Website">Website</button>
|
||||||
<button id="wiki-btn" title="Wiki">Wiki</button>
|
<button id="wiki-btn" title="Wiki">Wiki</button>
|
||||||
|
<!-- <button id="theme-btn" title="Theme">Theme</button> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="window-controls">
|
<div class="window-controls">
|
||||||
<button id="minimize-btn" title="Réduire"><img src="assets/icon/minimize.svg"></button>
|
<button id="minimize-btn" title="Réduire"><img src="assets/icon/minimize.svg"></button>
|
||||||
@@ -193,6 +194,7 @@
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
<div class="settings-footer">
|
<div class="settings-footer">
|
||||||
|
<button id="open-theme">Open Theme Folder</button>
|
||||||
<button id="open-json-btn">Open JSON Configuration</button>
|
<button id="open-json-btn">Open JSON Configuration</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ function setupTopbarListeners() {
|
|||||||
const logsBtn = document.getElementById('logs-btn');
|
const logsBtn = document.getElementById('logs-btn');
|
||||||
const websiteBtn = document.getElementById('website-btn');
|
const websiteBtn = document.getElementById('website-btn');
|
||||||
const wikiBtn = document.getElementById('wiki-btn');
|
const wikiBtn = document.getElementById('wiki-btn');
|
||||||
|
const themeBtn = document.getElementById('theme-btn');
|
||||||
const configBtn = document.getElementById('config-btn');
|
const configBtn = document.getElementById('config-btn');
|
||||||
|
|
||||||
if (minBtn) minBtn.onclick = () => topbarAPI.minimize();
|
if (minBtn) minBtn.onclick = () => topbarAPI.minimize();
|
||||||
@@ -19,6 +20,7 @@ function setupTopbarListeners() {
|
|||||||
if (logsBtn) logsBtn.onclick = () => topbarAPI.openLogs();
|
if (logsBtn) logsBtn.onclick = () => topbarAPI.openLogs();
|
||||||
if (websiteBtn) websiteBtn.onclick = () => topbarAPI.openWebsite();
|
if (websiteBtn) websiteBtn.onclick = () => topbarAPI.openWebsite();
|
||||||
if (wikiBtn) wikiBtn.onclick = () => topbarAPI.openWiki();
|
if (wikiBtn) wikiBtn.onclick = () => topbarAPI.openWiki();
|
||||||
|
if (themeBtn) themeBtn.onclick = () => topbarAPI.openTheme();
|
||||||
if (configBtn) configBtn.onclick = () => topbarAPI.openConfig();
|
if (configBtn) configBtn.onclick = () => topbarAPI.openConfig();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,6 +194,16 @@ details summary {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#open-theme {
|
||||||
|
padding: 10px 14px;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: 600;
|
||||||
|
background-color: var(--form-button-bg-color);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
#experimental-args {
|
#experimental-args {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
|
|||||||
Reference in New Issue
Block a user