2021-05-28 17:35:21 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../shared/popups"
|
|
|
|
import "../../../../shared/panels"
|
|
|
|
import "../../../../shared/status"
|
2021-05-28 17:35:21 +00:00
|
|
|
import ".."
|
|
|
|
|
|
|
|
Item {
|
2021-10-01 15:58:36 +00:00
|
|
|
id: root
|
2021-05-28 17:35:21 +00:00
|
|
|
width: parent.width
|
|
|
|
height: 64
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
property bool allBtnHighlighted: false
|
|
|
|
property bool repliesBtnHighlighted: false
|
|
|
|
property bool mentionsBtnHighlighted: false
|
|
|
|
property alias repliesBtnEnabled: repliesbtn.enabled
|
|
|
|
property alias mentionsBtnEnabled: mentionsBtn.enabled
|
|
|
|
property alias errorText: errorText.text
|
|
|
|
signal allBtnClicked()
|
|
|
|
signal repliesBtnClicked()
|
|
|
|
signal mentionsBtnClicked()
|
|
|
|
signal preferencesClicked()
|
|
|
|
signal markAllReadClicked()
|
|
|
|
|
2021-05-28 17:35:21 +00:00
|
|
|
Row {
|
|
|
|
id: filterButtons
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
height: allBtn.height
|
|
|
|
spacing: Style.current.padding
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: allBtn
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "All"
|
|
|
|
text: qsTrId("all")
|
2021-05-28 17:35:21 +00:00
|
|
|
type: "secondary"
|
|
|
|
size: "small"
|
2021-10-01 15:58:36 +00:00
|
|
|
highlighted: root.allBtnHighlighted
|
|
|
|
onClicked: {
|
|
|
|
root.allBtnClicked();
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: mentionsBtn
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Mentions"
|
|
|
|
text: qsTrId("mentions")
|
2021-05-28 17:35:21 +00:00
|
|
|
type: "secondary"
|
|
|
|
size: "small"
|
2021-10-01 15:58:36 +00:00
|
|
|
highlighted: root.mentionsBtnHighlighted
|
|
|
|
onClicked: {
|
|
|
|
root.mentionsBtnClicked();
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: repliesbtn
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Replies"
|
|
|
|
text: qsTrId("replies")
|
2021-05-28 17:35:21 +00:00
|
|
|
type: "secondary"
|
|
|
|
size: "small"
|
2021-10-01 15:58:36 +00:00
|
|
|
highlighted: root.repliesBtnHighlighted
|
|
|
|
onClicked: {
|
|
|
|
root.repliesBtnClicked();
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
|
2021-07-27 17:59:01 +00:00
|
|
|
// StatusButton {
|
|
|
|
// id: contactRequestsBtn
|
|
|
|
// //% "Contact requests"
|
|
|
|
// text: qsTrId("contact-requests")
|
|
|
|
// enabled: hasContactRequests
|
|
|
|
// type: "secondary"
|
|
|
|
// size: "small"
|
|
|
|
// highlighted: activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests
|
|
|
|
// onClicked: activityCenter.currentFilter = ActivityCenter.Filter.ContactRequests
|
|
|
|
// }
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Row {
|
|
|
|
id: otherButtons
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
height: markAllReadBtn.height
|
|
|
|
spacing: Style.current.padding
|
|
|
|
|
|
|
|
StatusIconButton {
|
|
|
|
id: markAllReadBtn
|
|
|
|
icon.name: "double-check"
|
|
|
|
iconColor: Style.current.primary
|
|
|
|
icon.width: 24
|
|
|
|
icon.height: 24
|
|
|
|
width: 32
|
|
|
|
height: 32
|
2021-10-01 15:58:36 +00:00
|
|
|
onClicked: markAllReadClicked()
|
2021-05-28 17:35:21 +00:00
|
|
|
|
|
|
|
StatusToolTip {
|
|
|
|
visible: markAllReadBtn.hovered
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Mark all as Read"
|
|
|
|
text: qsTrId("mark-all-as-read")
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusContextMenuButton {
|
|
|
|
id: moreActionsBtn
|
|
|
|
onClicked: moreActionsMenu.open()
|
|
|
|
|
2021-10-14 11:48:03 +00:00
|
|
|
// TODO: replace with StatusPopupMenu
|
2021-05-28 17:35:21 +00:00
|
|
|
PopupMenu {
|
|
|
|
id: moreActionsMenu
|
|
|
|
x: moreActionsBtn.width - moreActionsMenu.width
|
|
|
|
y: moreActionsBtn.height + 4
|
|
|
|
|
|
|
|
Action {
|
2021-09-28 15:04:06 +00:00
|
|
|
icon.source: hideReadNotifications ? Style.svg("eye") : Style.svg("eye-barred")
|
2021-05-28 17:35:21 +00:00
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
2021-07-16 20:22:50 +00:00
|
|
|
text: hideReadNotifications ?
|
|
|
|
//% "Show read notifications"
|
|
|
|
qsTrId("show-read-notifications") :
|
|
|
|
//% "Hide read notifications"
|
|
|
|
qsTrId("hide-read-notifications")
|
2021-06-10 15:15:38 +00:00
|
|
|
onTriggered: hideReadNotifications = !hideReadNotifications
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
Action {
|
2021-09-28 15:04:06 +00:00
|
|
|
icon.source: Style.svg("bell")
|
2021-05-28 17:35:21 +00:00
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Notification settings"
|
|
|
|
text: qsTrId("chat-notification-preferences")
|
2021-05-28 17:35:21 +00:00
|
|
|
onTriggered: {
|
2021-10-01 15:58:36 +00:00
|
|
|
root.preferencesClicked();
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-06-11 17:41:59 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: errorText
|
|
|
|
visible: !!text
|
|
|
|
anchors.top: filterButtons.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
color: Style.current.danger
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|