Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into feat/auto-update-reports
Browse files Browse the repository at this point in the history
  • Loading branch information
kamiya10 committed Feb 14, 2024
2 parents b5a51b2 + e65b397 commit 9278d1b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 新增開機時自動啟動的設定 (https://github.com/ExpTechTW/TREM-tauri/pull/30)
* 新增最小化至系統匣的設定 (https://github.com/ExpTechTW/TREM-tauri/pull/30)
* 新增啟動參數 `--quiet` 在開啟程式時隱藏視窗 (https://github.com/ExpTechTW/TREM-tauri/pull/30)
* 停用瀏覽器內建快捷鍵 (https://github.com/ExpTechTW/TREM-tauri/pull/31)
* 自動抓取並更新地震報告 (https://github.com/ExpTechTW/TREM-tauri/pull/32)

**完整變更紀錄**: https://github.com/ExpTechTW/TREM-tauri/compare/v0.0.0-alpha.2...v0.0.0-alpha.3
Expand Down
29 changes: 29 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,32 @@ browserWindow.onCloseRequested((event) => {
browserWindow.hide();
}
});

document.addEventListener("keydown", (ev) => {
// Disabling keyboard shortcuts
ev.preventDefault();

if (ev.ctrlKey && !ev.shiftKey && !ev.altKey) {
switch (ev.code) {
case "Digit1":
instance.changeView("home");
break;

case "Digit2":
instance.changeView("report-list");
break;

case "Digit3":
case "KeyO":
instance.changeView("setting");
break;

case "KeyR":
location.reload();
break;

default:
break;
}
}
});
5 changes: 3 additions & 2 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

:root {
font-family: "Lato", "Noto Sans TC", sans-serif;
font-synthesis: none;
text-rendering: optimizeLegibility;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand All @@ -31,6 +30,8 @@
}

body {
position: fixed;
inset: 0;
margin: 0;
background-color: hsl(var(--background-hsl));
color: #fff;
Expand Down

0 comments on commit 9278d1b

Please sign in to comment.