feat(preferences): option to hide account hover card (#1431)

This commit is contained in:
wheat 2023-01-24 15:46:33 -05:00 committed by GitHub
parent 4e97c31caf
commit 46a8472001
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 1 deletions

View file

@ -8,13 +8,15 @@ const props = defineProps<{
}>() }>()
const account = props.account || (props.handle ? useAccountByHandle(props.handle!) : undefined) const account = props.account || (props.handle ? useAccountByHandle(props.handle!) : undefined)
const userSettings = useUserSettings()
defineOptions({ defineOptions({
inheritAttrs: false, inheritAttrs: false,
}) })
</script> </script>
<template> <template>
<VMenu v-if="!disabled && account" placement="bottom-start" :delay="{ show: 500, hide: 100 }" v-bind="$attrs" :close-on-content-click="false"> <VMenu v-if="!disabled && account && !getPreferences(userSettings, 'hideAccountHoverCard')" placement="bottom-start" :delay="{ show: 500, hide: 100 }" v-bind="$attrs" :close-on-content-click="false">
<slot /> <slot />
<template #popper> <template #popper>
<AccountHoverCard v-if="account" :account="account" /> <AccountHoverCard v-if="account" :account="account" />

View file

@ -12,6 +12,7 @@ export interface PreferencesSettings {
hideFavoriteCount: boolean hideFavoriteCount: boolean
hideFollowerCount: boolean hideFollowerCount: boolean
hideTranslation: boolean hideTranslation: boolean
hideAccountHoverCard: boolean
grayscaleMode: boolean grayscaleMode: boolean
enableAutoplay: boolean enableAutoplay: boolean
experimentalVirtualScroller: boolean experimentalVirtualScroller: boolean
@ -64,6 +65,7 @@ export const DEFAULT__PREFERENCES_SETTINGS: PreferencesSettings = {
hideFavoriteCount: false, hideFavoriteCount: false,
hideFollowerCount: false, hideFollowerCount: false,
hideTranslation: false, hideTranslation: false,
hideAccountHoverCard: false,
grayscaleMode: false, grayscaleMode: false,
enableAutoplay: true, enableAutoplay: true,
experimentalVirtualScroller: true, experimentalVirtualScroller: true,

View file

@ -362,6 +362,7 @@
"enable_autoplay": "Enable Autoplay", "enable_autoplay": "Enable Autoplay",
"github_cards": "GitHub Cards", "github_cards": "GitHub Cards",
"grayscale_mode": "Grayscale mode", "grayscale_mode": "Grayscale mode",
"hide_account_hover_card": "Hide account hover card",
"hide_boost_count": "Hide boost count", "hide_boost_count": "Hide boost count",
"hide_favorite_count": "Hide favorite count", "hide_favorite_count": "Hide favorite count",
"hide_follower_count": "Hide follower count", "hide_follower_count": "Hide follower count",

View file

@ -39,6 +39,12 @@ const userSettings = useUserSettings()
> >
{{ $t('settings.preferences.hide_translation') }} {{ $t('settings.preferences.hide_translation') }}
</SettingsToggleItem> </SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideAccountHoverCard')"
@click="togglePreferences('hideAccountHoverCard')"
>
{{ $t('settings.preferences.hide_account_hover_card') }}
</SettingsToggleItem>
<SettingsToggleItem <SettingsToggleItem
:checked="getPreferences(userSettings, 'grayscaleMode')" :checked="getPreferences(userSettings, 'grayscaleMode')"
@click="togglePreferences('grayscaleMode')" @click="togglePreferences('grayscaleMode')"