feat(act-center): hide viewed notifications when clicking the hide btn
This commit is contained in:
parent
d5032430f9
commit
e27c66d8af
|
@ -20,6 +20,8 @@ Popup {
|
||||||
property bool hasReplies: false
|
property bool hasReplies: false
|
||||||
property bool hasContactRequests: contactList.count > 0
|
property bool hasContactRequests: contactList.count > 0
|
||||||
|
|
||||||
|
property bool hideReadNotifications: false
|
||||||
|
|
||||||
id: activityCenter
|
id: activityCenter
|
||||||
modal: true
|
modal: true
|
||||||
|
|
||||||
|
@ -75,7 +77,8 @@ Popup {
|
||||||
model: profileModel.contacts.contactRequests
|
model: profileModel.contacts.contactRequests
|
||||||
|
|
||||||
delegate: ContactRequest {
|
delegate: ContactRequest {
|
||||||
visible: activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests
|
visible: !hideReadNotifications &&
|
||||||
|
(activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests)
|
||||||
name: Utils.removeStatusEns(model.name)
|
name: Utils.removeStatusEns(model.name)
|
||||||
address: model.address
|
address: model.address
|
||||||
localNickname: model.localNickname
|
localNickname: model.localNickname
|
||||||
|
@ -150,9 +153,15 @@ Popup {
|
||||||
id: messageNotificationComponent
|
id: messageNotificationComponent
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: activityCenter.currentFilter === ActivityCenter.Filter.All ||
|
visible: {
|
||||||
(model.notificationType === Constants.acitivtyCenterNotificationTypeMention && activityCenter.currentFilter === ActivityCenter.Filter.Mentions) ||
|
if (hideReadNotifications && model.read) {
|
||||||
(model.notificationType === Constants.acitivtyCenterNotificationTypeReply && activityCenter.currentFilter === ActivityCenter.Filter.Replies)
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return activityCenter.currentFilter === ActivityCenter.Filter.All ||
|
||||||
|
(model.notificationType === Constants.acitivtyCenterNotificationTypeMention && activityCenter.currentFilter === ActivityCenter.Filter.Mentions) ||
|
||||||
|
(model.notificationType === Constants.acitivtyCenterNotificationTypeReply && activityCenter.currentFilter === ActivityCenter.Filter.Replies)
|
||||||
|
}
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height + Style.current.smallPadding
|
height: childrenRect.height + Style.current.smallPadding
|
||||||
color: model.read ? Style.current.transparent : Utils.setColorAlpha(Style.current.blue, 0.1)
|
color: model.read ? Style.current.transparent : Utils.setColorAlpha(Style.current.blue, 0.1)
|
||||||
|
|
|
@ -94,11 +94,11 @@ Item {
|
||||||
y: moreActionsBtn.height + 4
|
y: moreActionsBtn.height + 4
|
||||||
|
|
||||||
Action {
|
Action {
|
||||||
icon.source: "../../../../img/eye-barred.svg"
|
icon.source: hideReadNotifications ? "../../../../img/eye.svg" : "../../../../img/eye-barred.svg"
|
||||||
icon.width: 16
|
icon.width: 16
|
||||||
icon.height: 16
|
icon.height: 16
|
||||||
text: qsTr("Hide read notifications")
|
text: hideReadNotifications ? qsTr("Show read notifications") : qsTr("Hide read notifications")
|
||||||
onTriggered: console.log('TODO Change settings')
|
onTriggered: hideReadNotifications = !hideReadNotifications
|
||||||
}
|
}
|
||||||
Action {
|
Action {
|
||||||
icon.source: "../../../../img/bell.svg"
|
icon.source: "../../../../img/bell.svg"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f2678ea9506ea4ff5f380a16a9ee329313f35630
|
Subproject commit 43fa2edc1e6e0afa65724d47a95d47cd28c21d85
|
Loading…
Reference in New Issue