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-18 12:01:09 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
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
|
|
|
|
|
2021-10-18 12:01:09 +00:00
|
|
|
StatusFlatButton {
|
2021-05-28 17:35:21 +00:00
|
|
|
id: allBtn
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "All"
|
|
|
|
text: qsTrId("all")
|
2021-10-18 12:01:09 +00:00
|
|
|
size: StatusBaseButton.Size.Small
|
2021-10-01 15:58:36 +00:00
|
|
|
highlighted: root.allBtnHighlighted
|
2021-10-18 12:01:09 +00:00
|
|
|
onClicked: root.allBtnClicked();
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 12:01:09 +00:00
|
|
|
StatusFlatButton {
|
2021-05-28 17:35:21 +00:00
|
|
|
id: mentionsBtn
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Mentions"
|
|
|
|
text: qsTrId("mentions")
|
2021-10-18 12:01:09 +00:00
|
|
|
enabled: hasMentions
|
|
|
|
size: StatusBaseButton.Size.Small
|
2021-10-01 15:58:36 +00:00
|
|
|
highlighted: root.mentionsBtnHighlighted
|
|
|
|
onClicked: {
|
|
|
|
root.mentionsBtnClicked();
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 12:01:09 +00:00
|
|
|
StatusFlatButton {
|
2021-05-28 17:35:21 +00:00
|
|
|
id: repliesbtn
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Replies"
|
|
|
|
text: qsTrId("replies")
|
2021-10-18 12:01:09 +00:00
|
|
|
enabled: hasReplies
|
|
|
|
size: StatusBaseButton.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-10-18 12:01:09 +00:00
|
|
|
// StatusFlatButton {
|
2021-07-27 17:59:01 +00:00
|
|
|
// id: contactRequestsBtn
|
|
|
|
// //% "Contact requests"
|
|
|
|
// text: qsTrId("contact-requests")
|
|
|
|
// enabled: hasContactRequests
|
2021-10-18 12:01:09 +00:00
|
|
|
// size: StatusBaseButton.Size.Small
|
2021-07-27 17:59:01 +00:00
|
|
|
// 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
|
|
|
|
|
2021-10-18 12:01:09 +00:00
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: markAllReadBtn
|
|
|
|
icon.name: "double-checkmark"
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
onClicked: markAllReadClicked()
|
2021-05-28 17:35:21 +00:00
|
|
|
|
2021-10-18 12:01:09 +00:00
|
|
|
StatusToolTip {
|
|
|
|
visible: markAllReadBtn.hovered
|
|
|
|
//% "Mark all as Read"
|
|
|
|
text: qsTrId("mark-all-as-read")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: moreActionsBtn
|
|
|
|
icon.name: "more"
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
type: StatusFlatRoundButton.Type.Secondary
|
|
|
|
onClicked: {
|
2022-04-12 08:29:02 +00:00
|
|
|
let p = moreActionsBtn.mapToItem(otherButtons, moreActionsBtn.x, moreActionsBtn.y)
|
2021-10-18 12:01:09 +00:00
|
|
|
moreActionsMenu.popup(moreActionsBtn.width - moreActionsMenu.width, p.y + moreActionsBtn.height + 4)
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusPopupMenu {
|
|
|
|
id: moreActionsMenu
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
icon.name: "hide"
|
|
|
|
text: hideReadNotifications ?
|
|
|
|
//% "Show read notifications"
|
|
|
|
qsTrId("show-read-notifications") :
|
|
|
|
//% "Hide read notifications"
|
|
|
|
qsTrId("hide-read-notifications")
|
|
|
|
onTriggered: hideReadNotifications = !hideReadNotifications
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
icon.name: "notification"
|
|
|
|
//% "Notification settings"
|
|
|
|
text: qsTrId("chat-notification-preferences")
|
|
|
|
onTriggered: {
|
|
|
|
root.preferencesClicked();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|
2021-06-11 17:41:59 +00:00
|
|
|
|
2021-10-18 12:01:09 +00:00
|
|
|
StatusBaseText {
|
2021-06-11 17:41:59 +00:00
|
|
|
id: errorText
|
|
|
|
visible: !!text
|
|
|
|
anchors.top: filterButtons.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2021-10-18 12:01:09 +00:00
|
|
|
color: Theme.palette.dangerColor1
|
2021-06-11 17:41:59 +00:00
|
|
|
}
|
2021-05-28 17:35:21 +00:00
|
|
|
}
|