diff --git a/src/localization/en.json b/src/localization/en.json index 0212623a..a7a15bc2 100644 --- a/src/localization/en.json +++ b/src/localization/en.json @@ -519,7 +519,8 @@ "sort_instance_users_by": "Sort Instance Users by", "sort_instance_users_by_time": "time", "sort_instance_users_by_alphabet": "alphabetical", - "table_max_size": "Table Max Size" + "table_max_size": "Table Max Size", + "show_notification_icon_dot": "Show Tray Notification Dot" }, "timedate": { "header": "Time/Date", diff --git a/src/stores/settings/appearance.js b/src/stores/settings/appearance.js index abc86654..29f056d8 100644 --- a/src/stores/settings/appearance.js +++ b/src/stores/settings/appearance.js @@ -19,6 +19,7 @@ import { useFriendStore } from '../friend'; import { useGameLogStore } from '../gameLog'; import { useModerationStore } from '../moderation'; import { useNotificationStore } from '../notification'; +import { useUiStore } from '../ui'; import { useUserStore } from '../user'; import { useVrStore } from '../vr'; import { useVrcxStore } from '../vrcx'; @@ -39,6 +40,7 @@ export const useAppearanceSettingsStore = defineStore( const vrcxStore = useVrcxStore(); const userStore = useUserStore(); const router = useRouter(); + const uiStore = useUiStore(); const { t, availableLocales, locale } = useI18n(); @@ -79,6 +81,7 @@ export const useAppearanceSettingsStore = defineStore( troll: '#782F2F' }); const currentCulture = ref(''); + const notificationIconDot = ref(false); const isSideBarTabShow = computed(() => { const currentRouteName = router.currentRoute.value?.name; return !( @@ -109,7 +112,8 @@ export const useAppearanceSettingsStore = defineStore( hideUserMemosConfig, hideUnfriendsConfig, randomUserColoursConfig, - trustColorConfig + trustColorConfig, + notificationIconDotConfig ] = await Promise.all([ configRepository.getString('VRCX_appLanguage'), configRepository.getString('VRCX_ThemeMode', 'system'), @@ -160,7 +164,8 @@ export const useAppearanceSettingsStore = defineStore( vip: '#FF2626', troll: '#782F2F' }) - ) + ), + configRepository.getBool('VRCX_notificationIconDot', true) ]); if (!appLanguageConfig) { @@ -213,6 +218,7 @@ export const useAppearanceSettingsStore = defineStore( hideUserMemos.value = hideUserMemosConfig; hideUnfriends.value = hideUnfriendsConfig; randomUserColours.value = randomUserColoursConfig; + notificationIconDot.value = notificationIconDotConfig; // Migrate old settings // Assume all exist if one does @@ -424,6 +430,14 @@ export const useAppearanceSettingsStore = defineStore( displayVRCPlusIconsAsAvatar.value ); } + function setNotificationIconDot() { + notificationIconDot.value = !notificationIconDot.value; + configRepository.setBool( + 'VRCX_notificationIconDot', + notificationIconDot.value + ); + uiStore.updateTrayIconNotify(); + } function setHideNicknames() { hideNicknames.value = !hideNicknames.value; configRepository.setBool('VRCX_hideNicknames', hideNicknames.value); @@ -711,6 +725,7 @@ export const useAppearanceSettingsStore = defineStore( trustColor, currentCulture, isSideBarTabShow, + notificationIconDot, setAppLanguage, setDisplayVRCPlusIconsAsAvatar, @@ -741,7 +756,8 @@ export const useAppearanceSettingsStore = defineStore( userColourInit, applyUserTrustLevel, changeAppLanguage, - promptMaxTableSizeDialog + promptMaxTableSizeDialog, + setNotificationIconDot }; } ); diff --git a/src/stores/ui.js b/src/stores/ui.js index 1f1113b7..4e64ead3 100644 --- a/src/stores/ui.js +++ b/src/stores/ui.js @@ -7,6 +7,7 @@ import { useRouter } from 'vue-router'; import { AppDebug } from '../service/appConfig'; import { refreshCustomCss } from '../shared/utils/base/ui'; import { updateLocalizedStrings } from '../plugin/i18n'; +import { useAppearanceSettingsStore } from './settings/appearance'; import { useNotificationStore } from './notification'; import { useSearchStore } from './search'; @@ -15,6 +16,7 @@ export const useUiStore = defineStore('Ui', () => { const router = useRouter(); const keys = useMagicKeys(); const { directAccessPaste } = useSearchStore(); + const appearanceSettings = useAppearanceSettingsStore(); const ctrlR = keys['Ctrl+R']; const ctrlD = keys['Ctrl+D']; @@ -116,8 +118,9 @@ export const useUiStore = defineStore('Ui', () => { function updateTrayIconNotify(force = false) { const newState = - notifiedMenus.value.includes('notification') || - notifiedMenus.value.includes('friend-log'); + appearanceSettings.notificationIconDot && + (notifiedMenus.value.includes('notification') || + notifiedMenus.value.includes('friend-log')); if (trayIconNotify.value !== newState || force) { trayIconNotify.value = newState; @@ -136,6 +139,7 @@ export const useUiStore = defineStore('Ui', () => { notifyMenu, removeNotify, - showConsole + showConsole, + updateTrayIconNotify }; }); diff --git a/src/views/Settings/components/Tabs/AppearanceTab.vue b/src/views/Settings/components/Tabs/AppearanceTab.vue index fd1af2c8..59e1506a 100644 --- a/src/views/Settings/components/Tabs/AppearanceTab.vue +++ b/src/views/Settings/components/Tabs/AppearanceTab.vue @@ -54,6 +54,13 @@ style="width: 128px" @change="setZoomLevel" /> +