mirror of
https://github.com/rommapp/romm.git
synced 2026-12-05 23:44:11 +01:00
feat: change action bar on hover and add option to show it always (classic action bar)
This commit is contained in:
@@ -68,6 +68,11 @@ const languagesRef = ref(
|
||||
const storedStatus = localStorage.getItem("settings.showStatus");
|
||||
const statusRef = ref(isNull(storedStatus) ? true : storedStatus === "true");
|
||||
|
||||
const storedActionBar = localStorage.getItem("settings.showActionBar");
|
||||
const actionBarRef = ref(
|
||||
isNull(storedActionBar) ? false : storedActionBar === "true",
|
||||
);
|
||||
|
||||
const homeOptions = computed(() => [
|
||||
{
|
||||
title: t("settings.show-recently-added"),
|
||||
@@ -145,6 +150,14 @@ const galleryOptions = computed(() => [
|
||||
model: statusRef,
|
||||
modelTrigger: toggleStatus,
|
||||
},
|
||||
{
|
||||
title: t("settings.show-actionbar"),
|
||||
description: t("settings.show-actionbar-desc"),
|
||||
iconEnabled: "mdi-card",
|
||||
iconDisabled: "mdi-card-outline",
|
||||
model: actionBarRef,
|
||||
modelTrigger: toggleActionBar,
|
||||
},
|
||||
]);
|
||||
|
||||
// Functions to update localStorage
|
||||
@@ -203,6 +216,11 @@ const toggleStatus = (value: boolean) => {
|
||||
statusRef.value = value;
|
||||
localStorage.setItem("settings.showStatus", value.toString());
|
||||
};
|
||||
|
||||
const toggleActionBar = (value: boolean) => {
|
||||
actionBarRef.value = value;
|
||||
localStorage.setItem("settings.showActionBar", value.toString());
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<r-section
|
||||
|
||||
@@ -14,11 +14,12 @@ import {
|
||||
} from "@/utils";
|
||||
import { ROUTES } from "@/plugins/router";
|
||||
import type { Emitter } from "mitt";
|
||||
import { computed, inject } from "vue";
|
||||
import { computed, inject, ref, watch } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
// Props
|
||||
const props = defineProps<{ rom: SimpleRom }>();
|
||||
const emit = defineEmits(["menu-open", "menu-close"]);
|
||||
const downloadStore = storeDownload();
|
||||
const heartbeatStore = storeHeartbeat();
|
||||
const emitter = inject<Emitter<Events>>("emitter");
|
||||
@@ -43,6 +44,16 @@ const ruffleEmulationSupported = computed(() => {
|
||||
const is3DSRom = computed(() => {
|
||||
return is3DSCIARom(props.rom);
|
||||
});
|
||||
|
||||
const menuOpen = ref(false);
|
||||
|
||||
watch(menuOpen, (val) => {
|
||||
if (val) {
|
||||
emit("menu-open");
|
||||
} else {
|
||||
emit("menu-close");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -112,7 +123,7 @@ const is3DSRom = computed(() => {
|
||||
"
|
||||
class="d-flex"
|
||||
>
|
||||
<v-menu location="bottom">
|
||||
<v-menu location="bottom" v-model="menuOpen">
|
||||
<template #activator="{ props }">
|
||||
<v-btn
|
||||
@click.prevent
|
||||
|
||||
@@ -11,8 +11,9 @@ import storeGalleryView from "@/stores/galleryView";
|
||||
import { ROUTES } from "@/plugins/router";
|
||||
import storeRoms from "@/stores/roms";
|
||||
import { type SimpleRom } from "@/stores/roms";
|
||||
import { computed } from "vue";
|
||||
import { computed, ref } from "vue";
|
||||
import { getMissingCoverImage, getUnmatchedCoverImage } from "@/utils/covers";
|
||||
import { isNull } from "lodash";
|
||||
|
||||
// Props
|
||||
const props = withDefaults(
|
||||
@@ -82,10 +83,16 @@ const fallbackCoverImage = computed(() =>
|
||||
? getMissingCoverImage(props.rom.name || props.rom.slug || "")
|
||||
: getUnmatchedCoverImage(props.rom.name || props.rom.slug || ""),
|
||||
);
|
||||
const activeMenu = ref(false);
|
||||
const showActionBarAlways = isNull(
|
||||
localStorage.getItem("settings.showActionBar"),
|
||||
)
|
||||
? true
|
||||
: localStorage.getItem("settings.showActionBar") === "true";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-hover v-slot="{ isHovering, props: hoverProps }">
|
||||
<v-hover v-slot="{ isHovering: isOuterHovering, props: hoverProps }">
|
||||
<v-card
|
||||
:style="
|
||||
disableViewTransition ? {} : { viewTransitionName: `card-${rom.id}` }
|
||||
@@ -104,11 +111,11 @@ const fallbackCoverImage = computed(() =>
|
||||
}"
|
||||
class="bg-transparent"
|
||||
:class="{
|
||||
'on-hover': isHovering,
|
||||
'on-hover': isOuterHovering,
|
||||
'border-selected': withBorderPrimary,
|
||||
'transform-scale': transformScale,
|
||||
}"
|
||||
:elevation="isHovering && transformScale ? 20 : 3"
|
||||
:elevation="isOuterHovering && transformScale ? 20 : 3"
|
||||
>
|
||||
<v-card-text class="pa-0">
|
||||
<v-progress-linear
|
||||
@@ -235,6 +242,21 @@ const fallbackCoverImage = computed(() =>
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<v-expand-transition>
|
||||
<action-bar
|
||||
v-if="
|
||||
showActionBar &&
|
||||
!showActionBarAlways &&
|
||||
(isOuterHovering || activeMenu) &&
|
||||
romsStore.isSimpleRom(rom) &&
|
||||
!$vuetify.display.mobile
|
||||
"
|
||||
class="position-absolute append-inner translucent-dark"
|
||||
@menu-open="activeMenu = true"
|
||||
@menu-close="activeMenu = false"
|
||||
:rom="rom"
|
||||
/>
|
||||
</v-expand-transition>
|
||||
</v-img>
|
||||
</v-hover>
|
||||
<v-row v-if="titleOnFooter" class="pa-1 align-center">
|
||||
@@ -245,7 +267,11 @@ const fallbackCoverImage = computed(() =>
|
||||
</v-card-text>
|
||||
<slot name="footer"></slot>
|
||||
<action-bar
|
||||
v-if="showActionBar && romsStore.isSimpleRom(rom)"
|
||||
v-if="
|
||||
($vuetify.display.mobile || showActionBarAlways) &&
|
||||
showActionBar &&
|
||||
romsStore.isSimpleRom(rom)
|
||||
"
|
||||
:rom="rom"
|
||||
/>
|
||||
</v-card>
|
||||
@@ -277,6 +303,11 @@ const fallbackCoverImage = computed(() =>
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||
}
|
||||
.append-inner {
|
||||
bottom: 0rem;
|
||||
left: 0rem;
|
||||
right: 0rem;
|
||||
}
|
||||
.append-inner-left {
|
||||
bottom: 0rem;
|
||||
left: 0rem;
|
||||
|
||||
@@ -44,7 +44,9 @@
|
||||
"show-siblings-desc": "Die Anzahl der verschiedenen Versionen einen Roms wird in der Galerie angezeigt, wenn die \"Roms gruppieren\" Option aktiviert ist",
|
||||
"show-status": "Zeige Status",
|
||||
"show-status-desc": "Ziegt den aktuellen Status eines Roms als Icons in der Galerie an (Vorgemerkt, derzeit gespielt, durchgespielt, etc)",
|
||||
"show-virtual-collections": "Zeige automatisch generierte Sammlungen",
|
||||
"show-actionbar": "Show action bar",
|
||||
"show-actionbar": "Aktionsleiste anzeigen",
|
||||
"show-actionbar-desc": "Aktionsleiste immer auf der Spielkarte anzeigen",
|
||||
"show-virtual-collections-desc": "Wird auf der Startseite und in der Sammlungs-Seitenleiste angezeigt",
|
||||
"theme": "Erscheinungsbild",
|
||||
"theme-auto": "Auto",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "Show siblings count in the gallery when \"Group roms\" option is enabled",
|
||||
"show-status": "Show status",
|
||||
"show-status-desc": "Show status icons in the gallery (backlogged, playing, completed, etc)",
|
||||
"show-actionbar": "Show action bar",
|
||||
"show-actionbar-desc": "Show action bar in the game card always",
|
||||
"show-virtual-collections": "Show autogenerated collections",
|
||||
"show-virtual-collections-desc": "Displayed in the homepage and collections sidebar.",
|
||||
"theme": "Theme",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "Show siblings count in the gallery when \"Group roms\" option is enabled",
|
||||
"show-status": "Show status",
|
||||
"show-status-desc": "Show status icons in the gallery (backlogged, playing, completed, etc)",
|
||||
"show-actionbar": "Show action bar",
|
||||
"show-actionbar-desc": "Show action bar in the game card always",
|
||||
"show-virtual-collections": "Show autogenerated collections",
|
||||
"show-virtual-collections-desc": "Displayed in the homepage and collections sidebar.",
|
||||
"theme": "Theme",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "Mostrar el número de \"hermanos\" en la galería cuando la opción \"Agrupar roms\" está habilitada",
|
||||
"show-status": "Mostrar estado",
|
||||
"show-status-desc": "Mostrar icono de estado en la galería (backlogged, playing, completed, etc)",
|
||||
"show-actionbar": "Mostrar barra de acciones",
|
||||
"show-actionbar-desc": "Mostrar siempre la barra de acciones en la tarjeta del juego",
|
||||
"show-virtual-collections": "Mostrar colecciones generadas automáticamente",
|
||||
"show-virtual-collections-desc": "Mostrado en la página principal y en la barra lateral de colecciones.",
|
||||
"theme": "Tema",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "Afficher le nombre de frères et sœurs dans la galerie lorsque l'option \"Grouper les roms\" est activée",
|
||||
"show-status": "Afficher le statut",
|
||||
"show-status-desc": "Afficher les icônes de statut dans la galerie (en attente, en cours de lecture, terminé, etc.)",
|
||||
"show-actionbar": "Afficher la barre d'actions",
|
||||
"show-actionbar-desc": "Toujours afficher la barre d'actions sur la carte du jeu",
|
||||
"show-virtual-collections": "Afficher les collections générées automatiquement",
|
||||
"show-virtual-collections-desc": "Affiché sur la page d'accueil et dans la barre latérale des collections.",
|
||||
"theme": "Thème",
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
"show-siblings-desc": "Mostra il numero di versioni correlate nella galleria quando l'opzione \"Raggruppa rom\" è attivata",
|
||||
"show-status": "Mostra stato",
|
||||
"show-status-desc": "Mostra le icone di stato nella galleria (in attesa, in gioco, completato, ecc.)",
|
||||
"show-actionbar": "Mostra barra delle azioni",
|
||||
"show-actionbar-desc": "Mostra sempre la barra delle azioni nella scheda del gioco",
|
||||
"show-virtual-collections": "Mostra collezioni autogenerate",
|
||||
"show-virtual-collections-desc": "Visualizzate nella home e nella barra laterale delle collezioni",
|
||||
"theme": "Tema",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "\"Group roms\" オプションが有効な場合、キャラリーに系列数を表示",
|
||||
"show-status": "ステータを表示",
|
||||
"show-status-desc": "ギャラリーにステータスアイコンを表示 (未プレイ, プレイ中, 完了済, その他)",
|
||||
"show-actionbar": "アクションバーを表示",
|
||||
"show-actionbar-desc": "ゲームカードに常にアクションバーを表示",
|
||||
"show-virtual-collections": "自動生成されたコレクションを表示",
|
||||
"show-virtual-collections-desc": "ホームに自動生成されたコレクションを表示",
|
||||
"theme": "テーマ",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "\"롬 묶음\" 옵션이 활성화되었을 때 파생롬의 개수를 갤러리에서 보여줍니다",
|
||||
"show-status": "상태 보이기",
|
||||
"show-status-desc": "갤러리에서 상태 아이콘을 보여줍니다(플레이중, 완료됨 등)",
|
||||
"show-actionbar": "작업 표시줄 표시",
|
||||
"show-actionbar-desc": "게임 카드에서 항상 작업 표시줄을 표시",
|
||||
"show-virtual-collections": "자동 생성된 모음집 보이기",
|
||||
"show-virtual-collections-desc": "홈페이지와 모음집 사이드바에 표시됩니다",
|
||||
"theme": "테마",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "Mostrar contagem de irmãos na galeria quando a opção \"Agrupar roms\" estiver ativada",
|
||||
"show-status": "Mostrar status",
|
||||
"show-status-desc": "Mostrar ícones de status na galeria (em espera, jogando, concluído, etc)",
|
||||
"show-actionbar": "Mostrar barra de ações",
|
||||
"show-actionbar-desc": "Sempre mostrar a barra de ações no cartão do jogo",
|
||||
"show-virtual-collections": "Mostrar coleções geradas automaticamente",
|
||||
"show-virtual-collections-desc": "Exibido na página inicial e na barra lateral de coleções.",
|
||||
"theme": "Tema",
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
"show-siblings-desc": "Afișează numărul versiunilor alternative în galerie când opțiunea „Grupare rom-uri” este activată",
|
||||
"show-status": "Afișează statusul",
|
||||
"show-status-desc": "Afișează pictogramele de status în galerie (în așteptare, în curs de joc, finalizat etc.)",
|
||||
"show-actionbar": "Afișează bara de acțiuni",
|
||||
"show-actionbar-desc": "Afișează întotdeauna bara de acțiuni în cardul jocului",
|
||||
"show-virtual-collections": "Afișează colecțiile generate automat",
|
||||
"show-virtual-collections-desc": "Afișate pe pagina principală și în bara laterală a colecțiilor.",
|
||||
"theme": "Temă",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "Показать количество родственных в галерее, когда включена опция \"Группировать ромы\"",
|
||||
"show-status": "Показать статус",
|
||||
"show-status-desc": "Показать иконки статуса в галерее (в ожидании, играется, завершено и т.д.)",
|
||||
"show-actionbar": "Показать панель действий",
|
||||
"show-actionbar-desc": "Всегда показывать панель действий на карточке игры",
|
||||
"show-virtual-collections": "Показать автоматически созданные коллекции",
|
||||
"show-virtual-collections-desc": "Отображается на главной странице и в боковой панели коллекций.",
|
||||
"theme": "Тема",
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
"show-siblings-desc": "在启用\"Rom 文件组\"选项时将会在游戏库中显示已分组 Rom 的版本数量",
|
||||
"show-status": "显示状态",
|
||||
"show-status-desc": "在游戏库中显示状态标识(积压、游玩中、已完成等)",
|
||||
"show-actionbar": "显示操作栏",
|
||||
"show-actionbar-desc": "始终在游戏卡片中显示操作栏",
|
||||
"show-virtual-collections": "显示自动生成的收藏",
|
||||
"show-virtual-collections-desc": "在主页和收藏侧边栏中显示",
|
||||
"theme": "主题",
|
||||
|
||||
Reference in New Issue
Block a user