From 22e0852ae77a8f0f4947b8dbf90f36222be63fd7 Mon Sep 17 00:00:00 2001 From: Prozilla Date: Fri, 22 Dec 2023 15:03:06 +0100 Subject: [PATCH] QOL changes --- src/components/actions/actions/ClickAction.jsx | 5 +++-- src/components/taskbar/app-icon/AppIcon.jsx | 4 ++++ src/components/taskbar/menus/SearchMenu.jsx | 9 ++++++++- src/components/taskbar/menus/SearchMenu.module.css | 4 ++++ src/components/windows/WindowView.jsx | 5 ++++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/components/actions/actions/ClickAction.jsx b/src/components/actions/actions/ClickAction.jsx index 57ff5d0..52b142e 100644 --- a/src/components/actions/actions/ClickAction.jsx +++ b/src/components/actions/actions/ClickAction.jsx @@ -2,8 +2,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { formatShortcut } from "../../../features/utils/string.js"; import styles from "../Actions.module.css"; import { ImagePreview } from "../../applications/file-explorer/directory-list/ImagePreview.jsx"; +import { memo } from "react"; -export function ClickAction({ actionId, label, shortcut, onTrigger, icon }) { +export const ClickAction = memo(({ actionId, label, shortcut, onTrigger, icon }) => { return (); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/src/components/taskbar/app-icon/AppIcon.jsx b/src/components/taskbar/app-icon/AppIcon.jsx index 5c48071..2a20672 100644 --- a/src/components/taskbar/app-icon/AppIcon.jsx +++ b/src/components/taskbar/app-icon/AppIcon.jsx @@ -10,6 +10,7 @@ import { ClickAction } from "../../actions/actions/ClickAction.jsx"; import { faThumbTack, faTimes } from "@fortawesome/free-solid-svg-icons"; import { SettingsManager } from "../../../features/settings/settingsManager.js"; import { removeFromArray } from "../../../features/utils/array.js"; +import AppsManager from "../../../features/applications/applications.js"; /** * @param {object} props @@ -24,6 +25,9 @@ export const AppButton = memo(({ app, windowsManager, modalsManager, pins, activ const settingsManager = useSettingsManager(); const { onContextMenu } = useContextMenu({ modalsManager, Actions: (props) => + { + windowsManager.open(app.id); + }}/> { const newPins = [...pins]; if (isPinned) { diff --git a/src/components/taskbar/menus/SearchMenu.jsx b/src/components/taskbar/menus/SearchMenu.jsx index 559deda..8e17668 100644 --- a/src/components/taskbar/menus/SearchMenu.jsx +++ b/src/components/taskbar/menus/SearchMenu.jsx @@ -47,9 +47,16 @@ export function SearchMenu({ active, setActive, searchQuery, setSearchQuery, inp classNames.push(styles.Active); const onKeyDown = (event) => { - if (event.key === "f" && event.ctrlKey) { + if ((event.key === "f" || event.key === "g") && event.ctrlKey && !active) { event.preventDefault(); setActive(true); + } else if (event.key === "Escape" && active) { + event.preventDefault(); + setActive(false); + } else if (event.key === "Enter" && active) { + event.preventDefault(); + windowsManager.open(apps[0].id); + setActive(false); } }; diff --git a/src/components/taskbar/menus/SearchMenu.module.css b/src/components/taskbar/menus/SearchMenu.module.css index 8408e3f..968a0ce 100644 --- a/src/components/taskbar/menus/SearchMenu.module.css +++ b/src/components/taskbar/menus/SearchMenu.module.css @@ -51,4 +51,8 @@ outline: none; font-family: inherit; font-size: inherit; +} + +.Container-inner > div > button:first-child { + background-color: var(--taskbar-button-hover-color); } \ No newline at end of file diff --git a/src/components/windows/WindowView.jsx b/src/components/windows/WindowView.jsx index 6cc3896..42e3fbe 100644 --- a/src/components/windows/WindowView.jsx +++ b/src/components/windows/WindowView.jsx @@ -139,7 +139,10 @@ export const WindowView = memo(({ id, app, size, position, onInteract, options, height: maximized ? null : startSize.y, }} > -
+
{ + setMaximized(!maximized); + focus(event, true); + }}>