diff --git a/src/components/WindowDimmer.vue b/src/components/WindowDimmer.vue index 867ab82..c32fe3a 100644 --- a/src/components/WindowDimmer.vue +++ b/src/components/WindowDimmer.vue @@ -5,7 +5,16 @@ [$style.active]: isActive, }" > -
+
+
+
+
+
@@ -18,6 +27,19 @@ export default { }; }, computed: { + displayNotificationBadge() { + return this.$store.getters['Settings/byKey']('dimmer.displayBadgeAtNewNotifications'); + }, + hasNewNotifications() { + return !this.windowHasFocus + && this.displayNotificationBadge + && this.notificationsAfterWindowBlur.length; + }, + notificationsAfterWindowBlur() { + return this.$store.getters['Notifications/list']({ + newerThanTimestamp: this.windowTimestampOfBlur, + }); + }, settingsIsDimActive() { return this.$store.getters['Settings/byKey']('dimmer.dimIfWindowIsNotInFocus'); }, @@ -27,6 +49,9 @@ export default { windowHasFocus() { return this.$store.getters['Window/hasFocus']; }, + windowTimestampOfBlur() { + return this.$store.getters['Window/timestampOfBlur']; + }, }, watch: { windowHasFocus(value) { @@ -68,7 +93,7 @@ export default { }; - diff --git a/src/store/modules/Settings.js b/src/store/modules/Settings.js index 72f7a4d..e2fb303 100644 --- a/src/store/modules/Settings.js +++ b/src/store/modules/Settings.js @@ -5,6 +5,7 @@ const db = new Connection({ defaults: { 'dimmer.dimDelayInMs': 5000, 'dimmer.dimIfWindowIsNotInFocus': false, + 'dimmer.displayBadgeAtNewNotifications': false, 'layout.sideBarLocation': 'left', 'navigation.displayHomeButton': true, 'navigation.displayTabLabels': true, diff --git a/src/views/Settings.vue b/src/views/Settings.vue index f591f66..911e57f 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -104,6 +104,18 @@ Set a delay before the dimmer starts (in seconds). + + + + +