Skip to content

Commit

Permalink
fix: setting
Browse files Browse the repository at this point in the history
  • Loading branch information
cstrikeasia committed Dec 3, 2024
1 parent 2aca437 commit 1a9c771
Show file tree
Hide file tree
Showing 4 changed files with 437 additions and 357 deletions.
9 changes: 8 additions & 1 deletion src/css/lang/zh-Hant/setting/main/box.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@
.failed.message-box:before {
content: "操作失敗!";
}

.extended-store:before {
content: "TREM 擴充商店";
}
.eew-1::before {
content: "EEW(收到地震預警時播放)";
}
Expand Down Expand Up @@ -573,6 +575,11 @@ body {
padding-left: 0.8vw;
}

.extended-store {
color: aqua;
text-decoration: none;
}

.extended-info {
color: #ff5656;
height: auto;
Expand Down
3 changes: 3 additions & 0 deletions src/js/plugin_edit/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ document.querySelector('.windows-wrapper').addEventListener('click', ({ target }
else if (target.classList.contains('minimize')) {
ipcRenderer.send('minimize-window');
}
else if (target.classList.contains('maximize')) {
ipcRenderer.send('maximize-window');
}
});
33 changes: 27 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,6 @@ function createSettingWindow() {
SettingWindow = null;
win.webContents.reload();
});
ipcMain.on('minimize-window', () => {
const currentWindow = BrowserWindow.getFocusedWindow();
if (currentWindow) {
currentWindow.minimize();
}
});
}

const shouldQuit = app.requestSingleInstanceLock();
Expand Down Expand Up @@ -322,6 +316,33 @@ ipcMain.on('openConfigFolder', () => {
});
});

ipcMain.on('minimize-window', () => {
const currentWindow = BrowserWindow.getFocusedWindow();
if (currentWindow) {
currentWindow.minimize();
}
});

ipcMain.on('maximize-window', () => {
const currentWindow = BrowserWindow.getFocusedWindow();
if (currentWindow) {
if (!currentWindow.isMaximized()) {
currentWindow.maximize();
}
currentWindow.setResizable(false);
}
});

ipcMain.on('restore-window', () => {
const currentWindow = BrowserWindow.getFocusedWindow();
if (currentWindow) {
if (currentWindow.isMaximized()) {
currentWindow.unmaximize();
}
currentWindow.setResizable(true);
}
});

function trayIcon() {
if (tray) {
tray.destroy();
Expand Down
Loading

0 comments on commit 1a9c771

Please sign in to comment.