add settings & quit shortcut

This commit is contained in:
an-lee
2024-01-10 20:48:00 +08:00
parent 6135818aea
commit bdd4ba015e
2 changed files with 11 additions and 1 deletions

View File

@@ -54,6 +54,10 @@ app.on("ready", async () => {
globalShortcut.register("CommandOrControl+Shift+I", () => {
mainWindow.win.webContents.toggleDevTools();
});
globalShortcut.register("CommandOrControl+Q", () => {
app.quit();
});
});
// Quit when all windows are closed, except on macOS. There, it's common

View File

@@ -11,7 +11,6 @@ import {
HeadphonesIcon,
VideoIcon,
NewspaperIcon,
BookOpenTextIcon,
BookMarkedIcon,
UserIcon,
BotIcon,
@@ -20,11 +19,17 @@ import { useLocation, Link } from "react-router-dom";
import { t } from "i18next";
import { Preferences } from "@renderer/components";
import { Tooltip } from "react-tooltip";
import { useHotkeys } from "react-hotkeys-hook";
export const Sidebar = () => {
const location = useLocation();
const activeTab = location.pathname;
useHotkeys("Control+Comma", () => {
console.log("open preferences");
document.getElementById("preferences-button")?.click();
});
return (
<div className="h-[100vh] w-20 xl:w-48 2xl:w-64 transition-all relative">
<div className="fixed top-0 left-0 h-full w-20 xl:w-48 2xl:w-64">
@@ -210,6 +215,7 @@ export const Sidebar = () => {
? "secondary"
: "ghost"
}
id="preferences-button"
className="w-full xl:justify-start"
data-tooltip-id="sidebar-tooltip"
data-tooltip-content={t("sidebar.preferences")}