+
diff --git a/package.json b/package.json
index b693337..ffbc8c4 100755
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "ed-safari",
"productName": "ed-safari",
- "version": "1.0.0",
+ "version": "0.1.0",
"description": "My Electron application description",
"main": ".vite/build/main.js",
"scripts": {
diff --git a/src/assets/index.css b/src/assets/index.css
index d0d72be..529604e 100755
--- a/src/assets/index.css
+++ b/src/assets/index.css
@@ -19,6 +19,8 @@
--grey-text: #9f9f9f;
--grey-bg: #333333;
+
+ --shadow: 0 0 3px;
}
body {
@@ -39,7 +41,7 @@ body {
margin-top: 1px;
margin-bottom: 1px;
padding-left: 10px;
- text-shadow: 0px 0px 3px;
+ text-shadow: var(--shadow);
margin-left: 1px;
margin-right: 1px;
}
@@ -124,7 +126,7 @@ div b.active.landable {
color: var(--main);
border-color: var(--main);
border-width: 1px 0px 1px 0px;
- text-shadow: 0px 0px 3px;
+ text-shadow: var(--shadow);
opacity: 100%;
}
@@ -184,9 +186,18 @@ div b.active.landable {
user-select: none;
}
+#titlebar .title {
+ color: var(--grey-text);
+ text-shadow: var(--shadow);
+}
+
#titlebar .btn-close {
-webkit-app-region: no-drag;
- filter: drop-shadow(0 0px 3px var(--grey-text)) var(--bs-btn-close-white-filter);
+ filter: drop-shadow(var(--shadow) var(--grey-text)) var(--bs-btn-close-white-filter);
width: 0.4em;
height: 0.4em;
+}
+
+#titlebar .btn-settings {
+ background: transparent url('./../icons/gear.svg') center/1em auto no-repeat;
}
\ No newline at end of file
diff --git a/src/icons/gear.svg b/src/icons/gear.svg
new file mode 100644
index 0000000..c11dbc1
--- /dev/null
+++ b/src/icons/gear.svg
@@ -0,0 +1,4 @@
+
\ No newline at end of file
diff --git a/src/icons/gear.svg:Zone.Identifier b/src/icons/gear.svg:Zone.Identifier
new file mode 100644
index 0000000..28099e5
--- /dev/null
+++ b/src/icons/gear.svg:Zone.Identifier
@@ -0,0 +1,4 @@
+[ZoneTransfer]
+ZoneId=3
+ReferrerUrl=https://icons.getbootstrap.com/icons/gear/
+HostUrl=https://icons.getbootstrap.com/assets/icons/gear.svg
diff --git a/src/main.js b/src/main.js
index 41d0070..bd67bfb 100755
--- a/src/main.js
+++ b/src/main.js
@@ -44,11 +44,24 @@ const closeWindow = (event) => {
window?.close();
}
+// Set up settings page handler.
+const loadSettings = (event) => {
+ const webContents = event.sender;
+ const window = BrowserWindow.fromWebContents(webContents);
+
+ if (SETTINGS_WINDOW_VITE_DEV_SERVER_URL) {
+ window.loadURL(`${SETTINGS_WINDOW_VITE_DEV_SERVER_URL}/settings.html`);
+ } else {
+ window.loadFile(path.join(__dirname, `../renderer/${SETTINGS_WINDOW_VITE_NAME}/settings.html`));
+ }
+}
+
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', () => {
ipcMain.on('CLOSE_WINDOW', closeWindow);
+ ipcMain.on('LOAD_SETTINGS', loadSettings);
createWindow();
});
@@ -70,62 +83,4 @@ app.on('activate', () => {
});
// In this file you can include the rest of your app's specific main process
-// code. You can also put them in separate files and import them here.
-
-// const openSettings = async () => {
-// settingsWindow = new BrowserWindow({
-// width: 800,
-// height: 600,
-// parent: mainWindow,
-// modal: true,
-// show: false,
-// webPreferences: {
-// nodeIntegration: true,
-// contextIsolation: false,
-// additionalArguments: [`EDS-ENV=${app.isPackaged}`],
-// },
-// });
-
-// if (SETTINGS_WINDOW_VITE_DEV_SERVER_URL) {
-// settingsWindow.loadURL(`${SETTINGS_WINDOW_VITE_DEV_SERVER_URL}/settings.html`);
-// } else {
-// settingsWindow.loadFile(path.join(__dirname, `../renderer/${SETTINGS_WINDOW_VITE_NAME}/settings.html`));
-// }
-
-// // Open the DevTools.
-// if (!app.isPackaged) {
-// settingsWindow.webContents.openDevTools();
-// }
-
-// settingsWindow.show();
-
-// // Make sure window is destroyed on close, or else it won't open again.
-// settingsWindow.on('closed', () => {
-// settingsWindow = undefined;
-// });
-// }
-
-// const menuTemplate = [
-// {
-// label: 'File',
-// submenu: [
-// { label: 'Settings', click: async () => { openSettings(); } },
-// { role: 'quit' }
-// ]
-// },
-// {
-// role: 'help',
-// submenu: [
-// {
-// label: 'Github',
-// click: async () => {
-// const { shell } = require('electron');
-// await shell.openExternal('https://github.com/punkfairie/ed-safari');
-// }
-// }
-// ]
-// }
-// ]
-
-// const menu = Menu.buildFromTemplate(menuTemplate)
-// Menu.setApplicationMenu(menu)
\ No newline at end of file
+// code. You can also put them in separate files and import them here.
\ No newline at end of file
diff --git a/src/renderer.js b/src/renderer.js
index d23e52c..ab5005e 100755
--- a/src/renderer.js
+++ b/src/renderer.js
@@ -66,6 +66,12 @@ $('#closeBtn').on('click', () => {
ipcRenderer.send('CLOSE_WINDOW')
})
+/* ----------------------------------------------------------------- settings button handler ---- */
+
+$('#settingsBtn').on('click', () => {
+ ipcRenderer.send('LOAD_SETTINGS')
+})
+
/* ------------------------------------------------------------------------- build body list ---- */
journal.once('BUILD_BODY_LIST', () => {