From ca6331e45b46e1648b781ffc0da86d5c4f2544b8 Mon Sep 17 00:00:00 2001 From: caduHD4 Date: Sun, 21 Sep 2025 01:48:22 -0300 Subject: [PATCH] fix: improve context menu shortcut styling --- src/locales/en/translation.json | 1 + src/locales/pt-BR/translation.json | 1 + .../components/context-menu/context-menu.scss | 5 ++ .../components/context-menu/context-menu.tsx | 4 +- .../game-context-menu/game-context-menu.tsx | 3 +- .../game-details/modals/repacks-modal.scss | 63 +++++++++++++------ .../game-details/modals/repacks-modal.tsx | 23 ++++--- 7 files changed, 71 insertions(+), 29 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 945f4cc8..c79741c3 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -119,6 +119,7 @@ "open_folder": "Open folder", "open_download_location": "See downloaded files", "create_shortcut": "Create desktop shortcut", + "create_shortcut_simple": "Create shortcut", "clear": "Clear", "remove_files": "Remove files", "remove_from_library_title": "Are you sure?", diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index b1bd01fa..076b18fa 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -107,6 +107,7 @@ "open_folder": "Abrir pasta", "open_download_location": "Ver arquivos baixados", "create_shortcut": "Criar atalho na área de trabalho", + "create_shortcut_simple": "Criar atalho", "remove_files": "Remover arquivos", "options": "Gerenciar", "properties": "Propriedades", diff --git a/src/renderer/src/components/context-menu/context-menu.scss b/src/renderer/src/components/context-menu/context-menu.scss index 2c066440..e8ac6593 100644 --- a/src/renderer/src/components/context-menu/context-menu.scss +++ b/src/renderer/src/components/context-menu/context-menu.scss @@ -130,6 +130,11 @@ margin-top: 4px; } + &--game-not-installed &__submenu &__item--danger:first-of-type { + border-top: none; + margin-top: 0; + } + &__separator { height: 1px; background: globals.$border-color; diff --git a/src/renderer/src/components/context-menu/context-menu.tsx b/src/renderer/src/components/context-menu/context-menu.tsx index f1c2950e..ebbc6b70 100644 --- a/src/renderer/src/components/context-menu/context-menu.tsx +++ b/src/renderer/src/components/context-menu/context-menu.tsx @@ -20,6 +20,7 @@ export interface ContextMenuProps { position: { x: number; y: number }; onClose: () => void; children?: React.ReactNode; + className?: string; } export function ContextMenu({ @@ -28,6 +29,7 @@ export function ContextMenu({ position, onClose, children, + className, }: ContextMenuProps) { const menuRef = useRef(null); const [adjustedPosition, setAdjustedPosition] = useState(position); @@ -160,7 +162,7 @@ export function ContextMenu({ const menuContent = (
, disabled: isDeleting, submenu: [ @@ -181,6 +181,7 @@ export function GameContextMenu({ visible={visible} position={position} onClose={onClose} + className={!game.executablePath ? "context-menu--game-not-installed" : undefined} />

{t("filter_by_source")}

- {downloadSources.map((source) => ( -
- toggleFingerprint(source.fingerprint)} - /> -
- ))} +
+ {downloadSources.map((source) => ( +
+ toggleFingerprint(source.fingerprint)} + /> +
+ ))} +