refactor(ActivityCenterTopBar): make use of StatusQ components
This commit is contained in:
parent
845640bd13
commit
7f1b62fe32
|
@ -2,10 +2,12 @@ import QtQuick 2.13
|
|||
import QtQuick.Controls 2.13
|
||||
|
||||
import utils 1.0
|
||||
import "../../../../shared"
|
||||
import "../../../../shared/popups"
|
||||
import "../../../../shared/panels"
|
||||
import "../../../../shared/status"
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
|
@ -33,49 +35,45 @@ Item {
|
|||
height: allBtn.height
|
||||
spacing: Style.current.padding
|
||||
|
||||
StatusButton {
|
||||
StatusFlatButton {
|
||||
id: allBtn
|
||||
//% "All"
|
||||
text: qsTrId("all")
|
||||
type: "secondary"
|
||||
size: "small"
|
||||
size: StatusBaseButton.Size.Small
|
||||
highlighted: root.allBtnHighlighted
|
||||
onClicked: {
|
||||
root.allBtnClicked();
|
||||
}
|
||||
onClicked: root.allBtnClicked();
|
||||
}
|
||||
|
||||
StatusButton {
|
||||
StatusFlatButton {
|
||||
id: mentionsBtn
|
||||
//% "Mentions"
|
||||
text: qsTrId("mentions")
|
||||
type: "secondary"
|
||||
size: "small"
|
||||
enabled: hasMentions
|
||||
size: StatusBaseButton.Size.Small
|
||||
highlighted: root.mentionsBtnHighlighted
|
||||
onClicked: {
|
||||
root.mentionsBtnClicked();
|
||||
}
|
||||
}
|
||||
|
||||
StatusButton {
|
||||
StatusFlatButton {
|
||||
id: repliesbtn
|
||||
//% "Replies"
|
||||
text: qsTrId("replies")
|
||||
type: "secondary"
|
||||
size: "small"
|
||||
enabled: hasReplies
|
||||
size: StatusBaseButton.Size.Small
|
||||
highlighted: root.repliesBtnHighlighted
|
||||
onClicked: {
|
||||
root.repliesBtnClicked();
|
||||
}
|
||||
}
|
||||
|
||||
// StatusButton {
|
||||
// StatusFlatButton {
|
||||
// id: contactRequestsBtn
|
||||
// //% "Contact requests"
|
||||
// text: qsTrId("contact-requests")
|
||||
// enabled: hasContactRequests
|
||||
// type: "secondary"
|
||||
// size: "small"
|
||||
// size: StatusBaseButton.Size.Small
|
||||
// highlighted: activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests
|
||||
// onClicked: activityCenter.currentFilter = ActivityCenter.Filter.ContactRequests
|
||||
// }
|
||||
|
@ -89,12 +87,9 @@ Item {
|
|||
height: markAllReadBtn.height
|
||||
spacing: Style.current.padding
|
||||
|
||||
StatusIconButton {
|
||||
StatusFlatRoundButton {
|
||||
id: markAllReadBtn
|
||||
icon.name: "double-check"
|
||||
iconColor: Style.current.primary
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.name: "double-checkmark"
|
||||
width: 32
|
||||
height: 32
|
||||
onClicked: markAllReadClicked()
|
||||
|
@ -106,20 +101,22 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
StatusContextMenuButton {
|
||||
StatusFlatRoundButton {
|
||||
id: moreActionsBtn
|
||||
onClicked: moreActionsMenu.open()
|
||||
icon.name: "more"
|
||||
width: 32
|
||||
height: 32
|
||||
type: StatusFlatRoundButton.Type.Secondary
|
||||
onClicked: {
|
||||
let p = moreActionsBtn.mapToItem(otherButtons, moreActionsBtn.x, moreActionsMenu.y)
|
||||
moreActionsMenu.popup(moreActionsBtn.width - moreActionsMenu.width, p.y + moreActionsBtn.height + 4)
|
||||
}
|
||||
|
||||
// TODO: replace with StatusPopupMenu
|
||||
PopupMenu {
|
||||
StatusPopupMenu {
|
||||
id: moreActionsMenu
|
||||
x: moreActionsBtn.width - moreActionsMenu.width
|
||||
y: moreActionsBtn.height + 4
|
||||
|
||||
Action {
|
||||
icon.source: hideReadNotifications ? Style.svg("eye") : Style.svg("eye-barred")
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
StatusMenuItem {
|
||||
icon.name: "hide"
|
||||
text: hideReadNotifications ?
|
||||
//% "Show read notifications"
|
||||
qsTrId("show-read-notifications") :
|
||||
|
@ -127,10 +124,9 @@ Item {
|
|||
qsTrId("hide-read-notifications")
|
||||
onTriggered: hideReadNotifications = !hideReadNotifications
|
||||
}
|
||||
Action {
|
||||
icon.source: Style.svg("bell")
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
|
||||
StatusMenuItem {
|
||||
icon.name: "notification"
|
||||
//% "Notification settings"
|
||||
text: qsTrId("chat-notification-preferences")
|
||||
onTriggered: {
|
||||
|
@ -141,11 +137,11 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
StatusBaseText {
|
||||
id: errorText
|
||||
visible: !!text
|
||||
anchors.top: filterButtons.bottom
|
||||
anchors.topMargin: Style.current.smallPadding
|
||||
color: Style.current.danger
|
||||
color: Theme.palette.dangerColor1
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue