mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 16:47:24 +00:00
feat(contacts-settings): add badge for requests in contacts settings
Fixes #5089
This commit is contained in:
parent
16f61db2f7
commit
cfd84d5ba0
@ -51,6 +51,13 @@ Column {
|
|||||||
(model.subsection === Constants.settingsSubsection.browserSettings && root.browserMenuItemEnabled) ||
|
(model.subsection === Constants.settingsSubsection.browserSettings && root.browserMenuItemEnabled) ||
|
||||||
(model.subsection === Constants.settingsSubsection.wallet && root.walletMenuItemEnabled)
|
(model.subsection === Constants.settingsSubsection.wallet && root.walletMenuItemEnabled)
|
||||||
}
|
}
|
||||||
|
badge.value: {
|
||||||
|
switch (model.subsection) {
|
||||||
|
case Constants.settingsSubsection.messaging:
|
||||||
|
return root.messagingStore.contactRequestsModel.count
|
||||||
|
default: return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,8 +77,6 @@ Column {
|
|||||||
switch (model.subsection) {
|
switch (model.subsection) {
|
||||||
case Constants.settingsSubsection.privacyAndSecurity:
|
case Constants.settingsSubsection.privacyAndSecurity:
|
||||||
return !root.privacyStore.mnemonicBackedUp
|
return !root.privacyStore.mnemonicBackedUp
|
||||||
case Constants.settingsSubsection.messaging:
|
|
||||||
return root.messagingStore.contactRequestsModel.count
|
|
||||||
default: return ""
|
default: return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,13 @@ import QtQuick 2.13
|
|||||||
import QtQuick.Controls 2.13
|
import QtQuick.Controls 2.13
|
||||||
import QtQuick.Layouts 1.13
|
import QtQuick.Layouts 1.13
|
||||||
|
|
||||||
|
import StatusQ.Core 0.1
|
||||||
import StatusQ.Components 0.1
|
import StatusQ.Components 0.1
|
||||||
import StatusQ.Controls 0.1
|
import StatusQ.Controls 0.1
|
||||||
import StatusQ.Core.Theme 0.1
|
import StatusQ.Core.Theme 0.1
|
||||||
|
|
||||||
import utils 1.0
|
import utils 1.0
|
||||||
|
|
||||||
import StatusQ.Core 0.1
|
|
||||||
import shared.views 1.0
|
import shared.views 1.0
|
||||||
import shared.panels 1.0
|
import shared.panels 1.0
|
||||||
import shared.popups 1.0
|
import shared.popups 1.0
|
||||||
@ -91,6 +91,7 @@ Item {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.leftMargin: Style.current.bigPadding
|
anchors.leftMargin: Style.current.bigPadding
|
||||||
btnText: qsTr("Pending Requests")
|
btnText: qsTr("Pending Requests")
|
||||||
|
badge.value: contactList.count
|
||||||
}
|
}
|
||||||
StatusTabButton {
|
StatusTabButton {
|
||||||
id: blockedBtn
|
id: blockedBtn
|
||||||
|
@ -5,11 +5,16 @@ import utils 1.0
|
|||||||
import "../"
|
import "../"
|
||||||
import "../panels"
|
import "../panels"
|
||||||
|
|
||||||
|
import StatusQ.Core 0.1
|
||||||
|
import StatusQ.Components 0.1
|
||||||
|
|
||||||
TabButton {
|
TabButton {
|
||||||
property string btnText: "Default Button"
|
property string btnText: "Default Button"
|
||||||
|
property alias badge: statusBadge
|
||||||
|
|
||||||
id: tabButton
|
id: tabButton
|
||||||
width: tabBtnText.width
|
width: tabBtnText.width +
|
||||||
|
(statusBadge.visible ? statusBadge.width + statusBadge.anchors.leftMargin : 0)
|
||||||
height: tabBtnText.height + 11
|
height: tabBtnText.height + 11
|
||||||
text: ""
|
text: ""
|
||||||
padding: 0
|
padding: 0
|
||||||
@ -26,6 +31,14 @@ TabButton {
|
|||||||
color: parent.checked || parent.hovered ? Style.current.textColor : Style.current.secondaryText
|
color: parent.checked || parent.hovered ? Style.current.textColor : Style.current.secondaryText
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatusBadge {
|
||||||
|
id: statusBadge
|
||||||
|
visible: value > 0
|
||||||
|
anchors.left: tabBtnText.right
|
||||||
|
anchors.leftMargin: 10
|
||||||
|
anchors.verticalCenter: tabBtnText.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: parent.checked || parent.hovered
|
visible: parent.checked || parent.hovered
|
||||||
color: parent.checked ? Style.current.primary : Style.current.secondaryBackground
|
color: parent.checked ? Style.current.primary : Style.current.secondaryBackground
|
||||||
|
Loading…
x
Reference in New Issue
Block a user