Skip to content

Commit

Permalink
changed color of shortcut "Add New" #335
Browse files Browse the repository at this point in the history
  • Loading branch information
mienaiyami committed Jan 21, 2024
1 parent d5c65d9 commit 40d7657
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/renderer/Components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ const Settings = (): ReactElement => {
</div>
<div className={`tab ${currentTab === TAB_INFO.shortcutKeys[0] ? "selected " : ""}`}>
{/* <h1>Shortcut Keys</h1> */}
<Shortcuts scrollIntoView={scrollIntoView} settingContRef={settingContRef} />
<Shortcuts scrollIntoView={scrollIntoView} />
</div>
<div className={`tab ${currentTab === TAB_INFO.makeTheme[0] ? "selected " : ""}`}>
<ThemeCont />
Expand Down
13 changes: 3 additions & 10 deletions src/renderer/Components/settings/Shortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,11 @@ const ShortcutInput = ({ command }: { command: ShortcutCommands }) => {
value={""}
onKeyDown={(e) => {
e.stopPropagation();
if (!["Tab", "Escape", "Escape"].includes(e.key)) e.preventDefault();
if (!["Tab", "Escape"].includes(e.key)) e.preventDefault();
}}
onKeyUp={(e) => {
e.preventDefault();
e.stopPropagation();
// if (["Control", "Shift", "Alt", "Tab", "Backspace"].includes(e.key)) return;
// settingContRef.current?.focus();
// if (e.key === "Backspace") {
// window.logger.log(`Deleting shortcut ${shortcuts[i].command}.${which}`);
// dispatch(setShortcuts({ index: i, key: "", which }));
// return;
// }

const newKey = window.keyFormatter(e.nativeEvent);
if (newKey === "") return;
Expand Down Expand Up @@ -95,10 +88,10 @@ const ShortcutInput = ({ command }: { command: ShortcutCommands }) => {
};

const Shortcuts = ({
settingContRef,
// settingContRef,
scrollIntoView,
}: {
settingContRef: React.RefObject<HTMLDivElement>;
// settingContRef: React.RefObject<HTMLDivElement>;
scrollIntoView: (
elementQuery: string,
tab: "settings" | "shortcutKeys" | "makeTheme" | "about" | "extras"
Expand Down
7 changes: 5 additions & 2 deletions src/renderer/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1886,10 +1886,13 @@
}
}
.addNewKey {
min-width: 6em;
width: 6em;
min-width: 7em;
width: 7em;
font-size: 0.9em;
text-align: center;
&::placeholder {
opacity: 1;
}
}
div.keyDisplay {
display: flex;
Expand Down

0 comments on commit 40d7657

Please sign in to comment.